From 52c8ade4adcf07abe72057e0a2a765aad1208119 Mon Sep 17 00:00:00 2001 From: Albert Kim Date: Thu, 27 Jun 2013 19:16:09 +0100 Subject: [PATCH 1/2] Made generic IE handle more cases Added a possible quote after file, so it can now handle cases like: 'file': 'http://www.a.com/b.mp4' --- youtube_dl/extractor/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 7a877b3bc..eaaca9804 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -102,7 +102,7 @@ def _real_extract(self, url): mobj = re.search(r'[^A-Za-z0-9]?(?:file|source)=(http[^\'"&]*)', webpage) if mobj is None: # Broaden the search a little bit: JWPlayer JS loader - mobj = re.search(r'[^A-Za-z0-9]?file:\s*["\'](http[^\'"&]*)', webpage) + mobj = re.search(r'[^A-Za-z0-9]?file["\']?:\s*["\'](http[^\'"&]*)', webpage) if mobj is None: # Try to find twitter cards info mobj = re.search(r' Date: Thu, 27 Jun 2013 19:18:15 +0100 Subject: [PATCH 2/2] Made 'video' the default title for generic IE --- youtube_dl/extractor/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index eaaca9804..759fd60a7 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -135,7 +135,7 @@ def _real_extract(self, url): # Video Title - Tagline | Site Name # and so on and so forth; it's just not practical video_title = self._html_search_regex(r'(.*)', - webpage, u'video title') + webpage, u'video title', default=u'video') # video uploader is domain name video_uploader = self._search_regex(r'(?:https?://)?([^/]*)/.*',