aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-30 18:33:10 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-30 18:33:49 +0100
commitfcdea2666d75e20c983e759f232e885e05c6475a (patch)
tree0ff51237e15124ad2599a677f55fca34bdfa2f88
parentc4db377cbb25c35c0e9df95f275d439cff75a770 (diff)
[collegehumor] Add support for embedded youtube videos (fixes #2277)
-rw-r--r--youtube_dl/extractor/collegehumor.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/youtube_dl/extractor/collegehumor.py b/youtube_dl/extractor/collegehumor.py
index a128041c4..026d023a0 100644
--- a/youtube_dl/extractor/collegehumor.py
+++ b/youtube_dl/extractor/collegehumor.py
@@ -28,7 +28,25 @@ class CollegeHumorIE(InfoExtractor):
'description': 'This video wasn\'t long enough, so we made it double-spaced.',
'age_limit': 10,
},
- }]
+ },
+ # embedded youtube video
+ {
+ 'url': 'http://www.collegehumor.com/embed/6950457',
+ 'info_dict': {
+ 'id': 'W5gMp3ZjYg4',
+ 'ext': 'mp4',
+ 'title': 'Funny Dogs Protecting Babies Compilation 2014 [NEW HD]',
+ 'uploader': 'Funnyplox TV',
+ 'uploader_id': 'funnyploxtv',
+ 'description': 'md5:b20fc87608e2837596bbc8df85a3c34d',
+ 'upload_date': '20140128',
+ },
+ 'params': {
+ 'skip_download': True,
+ },
+ 'add_ie': ['Youtube'],
+ },
+ ]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
@@ -38,6 +56,12 @@ class CollegeHumorIE(InfoExtractor):
data = json.loads(self._download_webpage(
jsonUrl, video_id, 'Downloading info JSON'))
vdata = data['video']
+ if vdata.get('youtubeId') is not None:
+ return {
+ '_type': 'url',
+ 'url': vdata['youtubeId'],
+ 'ie_key': 'Youtube',
+ }
AGE_LIMITS = {'nc17': 18, 'r': 18, 'pg13': 13, 'pg': 10, 'g': 0}
rating = vdata.get('rating')