diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-01-08 01:18:47 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-01-08 01:18:47 +0100 |
commit | 10bff13a6687527c2290c9345c50a337771a0bb1 (patch) | |
tree | 0af4d1c0884b3864f044badfdc9efdfa8850a93e /youtube_dl/extractor | |
parent | 166ff8a3c7f18e0ab34660d526592b1a6c62df98 (diff) |
[novamov] Simplify
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/novamov.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/youtube_dl/extractor/novamov.py b/youtube_dl/extractor/novamov.py index e26b5522b..50e3233ce 100644 --- a/youtube_dl/extractor/novamov.py +++ b/youtube_dl/extractor/novamov.py @@ -8,9 +8,8 @@ from ..utils import ( compat_urlparse ) + class NovamovIE(InfoExtractor): - IE_NAME = 'novamov' - IE_DESC = 'novamov.com videos' _VALID_URL = r'http://(?:www\.novamov\.com/video/|embed\.novamov\.com/embed\.php\?v=)(?P<videoid>[a-z\d]{13})' _TEST = { @@ -33,11 +32,8 @@ class NovamovIE(InfoExtractor): if re.search(r'This file no longer exists on our servers!</h2>', page) is not None: raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) - mobj= re.search(r'flashvars\.filekey="(?P<filekey>[^"]+)";', page) - if mobj is None: - raise ExtractorError('Unable to extract filekey', expected=True) - - filekey = mobj.group('filekey') + filekey = self._search_regex( + r'flashvars\.filekey="(?P<filekey>[^"]+)";', page, 'filekey') title = self._html_search_regex( r'(?s)<div class="v_tab blockborder rounded5" id="v_tab1">\s*<h3>([^<]+)</h3>', @@ -47,8 +43,9 @@ class NovamovIE(InfoExtractor): r'(?s)<div class="v_tab blockborder rounded5" id="v_tab1">\s*<h3>[^<]+</h3><p>([^<]+)</p>', page, 'description', fatal=False) - api_response = self._download_webpage('http://www.novamov.com/api/player.api.php?key=%s&file=%s' % (filekey, video_id), - video_id, 'Downloading video api response') + api_response = self._download_webpage( + 'http://www.novamov.com/api/player.api.php?key=%s&file=%s' % (filekey, video_id), + video_id, 'Downloading video api response') response = compat_urlparse.parse_qs(api_response) @@ -62,4 +59,4 @@ class NovamovIE(InfoExtractor): 'url': video_url, 'title': title, 'description': description - }
\ No newline at end of file + } |