mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 21:47:23 +08:00
[nytimes] Allow _html_search_regex() to fail
Per @dstftw, allow _html_search_regex() to fail instead of raising UnsupportedError() on our own.
This commit is contained in:
parent
3915b5193e
commit
001a30f335
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user