diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-01-06 01:42:58 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-01-06 01:42:58 +0100 |
commit | fc9713a1d20b27848676ec84f7d29bf3f6ef4126 (patch) | |
tree | 36a542a4c02801c74923a430379cf3e2f8360868 /youtube_dl/extractor/generic.py | |
parent | 7f9886379c2fae64045d29999b52f66730a3cc34 (diff) |
[youtube] Support jwplayer with YouTube URLs (Closes #2075)
Diffstat (limited to 'youtube_dl/extractor/generic.py')
-rw-r--r-- | youtube_dl/extractor/generic.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 8534c6f90..62c918b6a 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -4,6 +4,7 @@ import os import re from .common import InfoExtractor +from .youtube import YoutubeIE from ..utils import ( compat_urllib_error, compat_urllib_parse, @@ -339,12 +340,16 @@ class GenericIE(InfoExtractor): video_url = compat_urlparse.urljoin(url, video_url) video_id = compat_urllib_parse.unquote(os.path.basename(video_url)) + # Sometimes, jwplayer extraction will result in a YouTube URL + if YoutubeIE.suitable(video_url): + return self.url_result(video_url, 'Youtube') + # here's a fun little line of code for you: video_id = os.path.splitext(video_id)[0] return { - 'id': video_id, - 'url': video_url, + 'id': video_id, + 'url': video_url, 'uploader': video_uploader, - 'title': video_title, + 'title': video_title, } |