X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fnovamov.py;h=6af8d934c8baa18b457fe1bdc3e96f42b5a82588;hb=c4db377cbb25c35c0e9df95f275d439cff75a770;hp=e26b5522b33d8566f172df103b47389e3d333e9c;hpb=cc253000e4db86e75a54ef157faff72002a40cfb;p=youtube-dl diff --git a/youtube_dl/extractor/novamov.py b/youtube_dl/extractor/novamov.py index e26b5522b..6af8d934c 100644 --- a/youtube_dl/extractor/novamov.py +++ b/youtube_dl/extractor/novamov.py @@ -8,10 +8,9 @@ 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[a-z\d]{13})' + _VALID_URL = r'http://(?:(?:www\.)?novamov\.com/video/|(?:(?:embed|www)\.)novamov\.com/embed\.php\?v=)(?P[a-z\d]{13})' _TEST = { 'url': 'http://www.novamov.com/video/4rurhn9x446jj', @@ -20,7 +19,8 @@ class NovamovIE(InfoExtractor): 'info_dict': { 'title': 'search engine optimization', 'description': 'search engine optimization is used to rank the web page in the google search engine' - } + }, + 'skip': '"Invalid token" errors abound (in web interface as well as youtube-dl, there is nothing we can do about it.)' } def _real_extract(self, url): @@ -33,11 +33,8 @@ class NovamovIE(InfoExtractor): if re.search(r'This file no longer exists on our servers!', page) is not None: raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) - mobj= re.search(r'flashvars\.filekey="(?P[^"]+)";', 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[^"]+)";', page, 'filekey') title = self._html_search_regex( r'(?s)
\s*

([^<]+)

', @@ -47,8 +44,9 @@ class NovamovIE(InfoExtractor): r'(?s)
\s*

[^<]+

([^<]+)

', 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 +60,4 @@ class NovamovIE(InfoExtractor): 'url': video_url, 'title': title, 'description': description - } \ No newline at end of file + }