projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
47c7f3d
)
[novamov] Improve existence checking
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 13 Dec 2015 07:37:52 +0000
(15:37 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 13 Dec 2015 07:43:20 +0000
(15:43 +0800)
youtube_dl/extractor/novamov.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/novamov.py
b/youtube_dl/extractor/novamov.py
index 0c4ff90f2d872d90bb59dfb4aab3d982ebcef3c0..a2a527ac380925fa9b0bf93b558da4dfccc00e73 100644
(file)
--- a/
youtube_dl/extractor/novamov.py
+++ b/
youtube_dl/extractor/novamov.py
@@
-40,6
+40,10
@@
class NovaMovIE(InfoExtractor):
'skip': '"Invalid token" errors abound (in web interface as well as youtube-dl, there is nothing we can do about it.)'
}
'skip': '"Invalid token" errors abound (in web interface as well as youtube-dl, there is nothing we can do about it.)'
}
+ def _check_existence(self, webpage, video_id):
+ if re.search(self._FILE_DELETED_REGEX, webpage) is not None:
+ raise ExtractorError('Video %s does not exist' % video_id, expected=True)
+
def _real_extract(self, url):
video_id = self._match_id(url)
def _real_extract(self, url):
video_id = self._match_id(url)
@@
-48,8
+52,7
@@
class NovaMovIE(InfoExtractor):
webpage = self._download_webpage(
url, video_id, 'Downloading video page')
webpage = self._download_webpage(
url, video_id, 'Downloading video page')
- if re.search(self._FILE_DELETED_REGEX, webpage) is not None:
- raise ExtractorError('Video %s does not exist' % video_id, expected=True)
+ self._check_existence(webpage, video_id)
def extract_filekey(default=NO_DEFAULT):
filekey = self._search_regex(
def extract_filekey(default=NO_DEFAULT):
filekey = self._search_regex(
@@
-75,6
+78,7
@@
class NovaMovIE(InfoExtractor):
request.add_header('Referer', post_url)
webpage = self._download_webpage(
request, video_id, 'Downloading continue to the video page')
request.add_header('Referer', post_url)
webpage = self._download_webpage(
request, video_id, 'Downloading continue to the video page')
+ self._check_existence(webpage, video_id)
filekey = extract_filekey()
filekey = extract_filekey()