[youtube] Modernize

pull/2/head
Philipp Hagemeister 10 years ago
parent bd5650ac64
commit 4bc3a23ec5

@ -307,69 +307,74 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
IE_NAME = 'youtube' IE_NAME = 'youtube'
_TESTS = [ _TESTS = [
{ {
u"url": u"http://www.youtube.com/watch?v=BaW_jenozKc", 'url': 'http://www.youtube.com/watch?v=BaW_jenozKc',
u"file": u"BaW_jenozKc.mp4", 'info_dict': {
u"info_dict": { 'id': 'BaW_jenozKc',
u"title": u"youtube-dl test video \"'/\\ä↭𝕐", 'ext': 'mp4',
u"uploader": u"Philipp Hagemeister", 'title': 'youtube-dl test video "\'/\\ä↭𝕐',
u"uploader_id": u"phihag", 'uploader': 'Philipp Hagemeister',
u"upload_date": u"20121002", 'uploader_id': 'phihag',
u"description": u"test chars: \"'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .", 'upload_date': '20121002',
u"categories": [u'Science & Technology'], 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .',
'categories': ['Science & Technology'],
'like_count': int, 'like_count': int,
'dislike_count': int, 'dislike_count': int,
} }
}, },
{ {
u"url": u"http://www.youtube.com/watch?v=UxxajLWwzqY", 'url': 'http://www.youtube.com/watch?v=UxxajLWwzqY',
u"file": u"UxxajLWwzqY.mp4", 'note': 'Test generic use_cipher_signature video (#897)',
u"note": u"Test generic use_cipher_signature video (#897)", 'info_dict': {
u"info_dict": { 'id': 'UxxajLWwzqY',
u"upload_date": u"20120506", 'ext': 'mp4',
u"title": u"Icona Pop - I Love It (feat. Charli XCX) [OFFICIAL VIDEO]", 'upload_date': '20120506',
u"description": u"md5:fea86fda2d5a5784273df5c7cc994d9f", 'title': 'Icona Pop - I Love It (feat. Charli XCX) [OFFICIAL VIDEO]',
u"uploader": u"Icona Pop", 'description': 'md5:fea86fda2d5a5784273df5c7cc994d9f',
u"uploader_id": u"IconaPop" 'uploader': 'Icona Pop',
'uploader_id': 'IconaPop',
} }
}, },
{ {
u"url": u"https://www.youtube.com/watch?v=07FYdnEawAQ", 'url': 'https://www.youtube.com/watch?v=07FYdnEawAQ',
u"file": u"07FYdnEawAQ.mp4", 'note': 'Test VEVO video with age protection (#956)',
u"note": u"Test VEVO video with age protection (#956)", 'info_dict': {
u"info_dict": { 'id': '07FYdnEawAQ',
u"upload_date": u"20130703", 'ext': 'mp4',
u"title": u"Justin Timberlake - Tunnel Vision (Explicit)", 'upload_date': '20130703',
u"description": u"md5:64249768eec3bc4276236606ea996373", 'title': 'Justin Timberlake - Tunnel Vision (Explicit)',
u"uploader": u"justintimberlakeVEVO", 'description': 'md5:64249768eec3bc4276236606ea996373',
u"uploader_id": u"justintimberlakeVEVO" 'uploader': 'justintimberlakeVEVO',
'uploader_id': 'justintimberlakeVEVO',
} }
}, },
{ {
u"url": u"//www.YouTube.com/watch?v=yZIXLfi8CZQ", 'url': '//www.YouTube.com/watch?v=yZIXLfi8CZQ',
u"file": u"yZIXLfi8CZQ.mp4", 'note': 'Embed-only video (#1746)',
u"note": u"Embed-only video (#1746)", 'info_dict': {
u"info_dict": { 'id': 'yZIXLfi8CZQ',
u"upload_date": u"20120608", 'ext': 'mp4',
u"title": u"Principal Sexually Assaults A Teacher - Episode 117 - 8th June 2012", 'upload_date': '20120608',
u"description": u"md5:09b78bd971f1e3e289601dfba15ca4f7", 'title': 'Principal Sexually Assaults A Teacher - Episode 117 - 8th June 2012',
u"uploader": u"SET India", 'description': 'md5:09b78bd971f1e3e289601dfba15ca4f7',
u"uploader_id": u"setindia" 'uploader': 'SET India',
'uploader_id': 'setindia'
} }
}, },
{ {
u"url": u"http://www.youtube.com/watch?v=a9LDPn-MO4I", 'url': 'http://www.youtube.com/watch?v=a9LDPn-MO4I',
u"file": u"a9LDPn-MO4I.m4a", 'note': '256k DASH audio (format 141) via DASH manifest',
u"note": u"256k DASH audio (format 141) via DASH manifest", 'info_dict': {
u"info_dict": { 'id': 'a9LDPn-MO4I',
u"upload_date": "20121002", 'ext': 'm4a',
u"uploader_id": "8KVIDEO", 'upload_date': '20121002',
u"description": '', 'uploader_id': '8KVIDEO',
u"uploader": "8KVIDEO", 'description': '',
u"title": "UHDTV TEST 8K VIDEO.mp4" 'uploader': '8KVIDEO',
'title': 'UHDTV TEST 8K VIDEO.mp4'
}, },
u"params": { 'params': {
u"youtube_include_dash_manifest": True, 'youtube_include_dash_manifest': True,
u"format": "141", 'format': '141',
}, },
}, },
# DASH manifest with encrypted signature # DASH manifest with encrypted signature
@ -384,7 +389,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
'uploader_id': 'AfrojackVEVO', 'uploader_id': 'AfrojackVEVO',
'upload_date': '20131011', 'upload_date': '20131011',
}, },
u"params": { 'params': {
'youtube_include_dash_manifest': True, 'youtube_include_dash_manifest': True,
'format': '141', 'format': '141',
}, },

Loading…
Cancel
Save