From 594df602d2b95e6ba8cb50a9a623803e8786cfc8 Mon Sep 17 00:00:00 2001 From: einstein95 Date: Wed, 25 Oct 2017 02:44:06 +1300 Subject: [PATCH 1/3] [nbc] Fix downloading classic-tv videos --- youtube_dl/extractor/nbc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py index 35151f527..bec1a93c3 100644 --- a/youtube_dl/extractor/nbc.py +++ b/youtube_dl/extractor/nbc.py @@ -15,7 +15,7 @@ from ..utils import ( class NBCIE(AdobePassIE): - _VALID_URL = r'https?(?P://(?:www\.)?nbc\.com/[^/]+/video/[^/]+/(?Pn?\d+))' + _VALID_URL = r'https?(?P://(?:www\.)?nbc\.com/(?:classic-tv/|)[^/]+/video/[^/]+/(?Pn?\d+))' _TESTS = [ { From c44d56005df6dfdda0951bfadf402130845bb5ef Mon Sep 17 00:00:00 2001 From: einstein95 Date: Wed, 25 Oct 2017 18:03:49 +1300 Subject: [PATCH 2/3] [nbc] Add test and fix from dstftw --- youtube_dl/extractor/nbc.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py index bec1a93c3..1be3e8f47 100644 --- a/youtube_dl/extractor/nbc.py +++ b/youtube_dl/extractor/nbc.py @@ -15,7 +15,7 @@ from ..utils import ( class NBCIE(AdobePassIE): - _VALID_URL = r'https?(?P://(?:www\.)?nbc\.com/(?:classic-tv/|)[^/]+/video/[^/]+/(?Pn?\d+))' + _VALID_URL = r'https?(?P://(?:www\.)?nbc\.com/(?:classic-tv/)?[^/]+/video/[^/]+/(?Pn?\d+))' _TESTS = [ { @@ -68,6 +68,23 @@ class NBCIE(AdobePassIE): }, 'skip': 'Only works from US', } + { + 'url': 'https://www.nbc.com/classic-tv/charles-in-charge/video/charles-in-charge-pilot/n3310', + 'info_dict': { + 'id': 'n3310', + 'ext': 'mp4', + 'title': 'Charles in Charge: Pilot', + 'description': 'Charles\' attempt to impress the campus beauty goes awry.', + 'timestamp': 465638400, + 'upload_date': '19841003', + 'uploader': 'NBCU-COM', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'skip': 'Only works from US', + }, ] def _real_extract(self, url): From de1d7ccf0cc862952409671133d184ef71c0b8a4 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Wed, 25 Oct 2017 23:23:00 +0700 Subject: [PATCH 3/3] Update nbc.py --- youtube_dl/extractor/nbc.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py index 1be3e8f47..554dec36e 100644 --- a/youtube_dl/extractor/nbc.py +++ b/youtube_dl/extractor/nbc.py @@ -67,23 +67,10 @@ class NBCIE(AdobePassIE): 'skip_download': True, }, 'skip': 'Only works from US', - } + }, { 'url': 'https://www.nbc.com/classic-tv/charles-in-charge/video/charles-in-charge-pilot/n3310', - 'info_dict': { - 'id': 'n3310', - 'ext': 'mp4', - 'title': 'Charles in Charge: Pilot', - 'description': 'Charles\' attempt to impress the campus beauty goes awry.', - 'timestamp': 465638400, - 'upload_date': '19841003', - 'uploader': 'NBCU-COM', - }, - 'params': { - # m3u8 download - 'skip_download': True, - }, - 'skip': 'Only works from US', + 'only_matching': True, }, ]