From 001a30f3352bcc829d8e6d4060af2a19cc2c4a82 Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sat, 15 Oct 2016 13:41:12 -0400 Subject: [PATCH] [nytimes] Allow _html_search_regex() to fail Per @dstftw, allow _html_search_regex() to fail instead of raising UnsupportedError() on our own. --- youtube_dl/extractor/nytimes.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/nytimes.py b/youtube_dl/extractor/nytimes.py index c4225acf7..d1579a2be 100644 --- a/youtube_dl/extractor/nytimes.py +++ b/youtube_dl/extractor/nytimes.py @@ -13,7 +13,6 @@ from ..utils import ( parse_iso8601, mimetype2ext, determine_ext, - UnsupportedError, ) @@ -210,8 +209,5 @@ class NYTimesArticleIE(NYTimesBaseIE): if video_id is not None: return self._extract_video_from_id(video_id) - data_json = self._html_search_regex(r'NYTD.FlexTypes.push\(({[^)]*)\)', webpage, 'json data', None, False); - if data_json is not None: - return self._extract_podcast_from_json(data_json, page_id, webpage) - else: - raise UnsupportedError(url) + data_json = self._html_search_regex(r'NYTD.FlexTypes.push\(({[^)]*)\)', webpage, 'json data') + return self._extract_podcast_from_json(data_json, page_id, webpage)