1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 00:54:31 +01:00

[nbc] Use NBC's id and fix _TESTS

ThePlatform URL gives the same ID for all _TESTS
This commit is contained in:
Yen Chi Hsuan 2016-01-31 04:34:46 +08:00
parent 670ad51ade
commit e881c4bcab

View File

@ -19,32 +19,39 @@ class NBCIE(InfoExtractor):
_TESTS = [ _TESTS = [
{ {
'url': 'http://www.nbc.com/the-tonight-show/segments/112966', 'url': 'http://www.nbc.com/the-tonight-show/segments/112966',
# md5 checksum is not stable
'info_dict': { 'info_dict': {
'id': 'c9xnCo0YPOPH', 'id': '112966',
'ext': 'flv', 'ext': 'mp4',
'title': 'Jimmy Fallon Surprises Fans at Ben & Jerry\'s', 'title': 'Jimmy Fallon Surprises Fans at Ben & Jerry\'s',
'description': 'Jimmy gives out free scoops of his new "Tonight Dough" ice cream flavor by surprising customers at the Ben & Jerry\'s scoop shop.', 'description': 'Jimmy gives out free scoops of his new "Tonight Dough" ice cream flavor by surprising customers at the Ben & Jerry\'s scoop shop.',
}, },
'params': {
# m3u8 download
'skip_download': True,
},
}, },
{ {
'url': 'http://www.nbc.com/the-tonight-show/episodes/176', 'url': 'http://www.nbc.com/the-tonight-show/episodes/176',
'info_dict': { 'info_dict': {
'id': 'XwU9KZkp98TH', 'id': '176',
'ext': 'flv', 'ext': 'flv',
'title': 'Ricky Gervais, Steven Van Zandt, ILoveMakonnen', 'title': 'Ricky Gervais, Steven Van Zandt, ILoveMakonnen',
'description': 'A brand new episode of The Tonight Show welcomes Ricky Gervais, Steven Van Zandt and ILoveMakonnen.', 'description': 'A brand new episode of The Tonight Show welcomes Ricky Gervais, Steven Van Zandt and ILoveMakonnen.',
}, },
'skip': 'Only works from US', 'skip': '404 Not Found',
}, },
{ {
'url': 'http://www.nbc.com/saturday-night-live/video/star-wars-teaser/2832821', 'url': 'http://www.nbc.com/saturday-night-live/video/star-wars-teaser/2832821',
'info_dict': { 'info_dict': {
'id': '8iUuyzWDdYUZ', 'id': '2832821',
'ext': 'flv', 'ext': 'mp4',
'title': 'Star Wars Teaser', 'title': 'Star Wars Teaser',
'description': 'md5:0b40f9cbde5b671a7ff62fceccc4f442', 'description': 'md5:0b40f9cbde5b671a7ff62fceccc4f442',
}, },
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Only works from US', 'skip': 'Only works from US',
}, },
{ {
@ -66,7 +73,11 @@ class NBCIE(InfoExtractor):
webpage, 'theplatform url').replace('_no_endcard', '').replace('\\/', '/'))) webpage, 'theplatform url').replace('_no_endcard', '').replace('\\/', '/')))
if theplatform_url.startswith('//'): if theplatform_url.startswith('//'):
theplatform_url = 'http:' + theplatform_url theplatform_url = 'http:' + theplatform_url
return self.url_result(smuggle_url(theplatform_url, {'source_url': url})) return {
'_type': 'url_transparent',
'url': smuggle_url(theplatform_url, {'source_url': url}),
'id': video_id,
}
class NBCSportsVPlayerIE(InfoExtractor): class NBCSportsVPlayerIE(InfoExtractor):