[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,
|
parse_iso8601,
|
||||||
mimetype2ext,
|
mimetype2ext,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
UnsupportedError,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -210,8 +209,5 @@ class NYTimesArticleIE(NYTimesBaseIE):
|
|||||||
if video_id is not None:
|
if video_id is not None:
|
||||||
return self._extract_video_from_id(video_id)
|
return self._extract_video_from_id(video_id)
|
||||||
|
|
||||||
data_json = self._html_search_regex(r'NYTD.FlexTypes.push\(({[^)]*)\)', webpage, 'json data', None, False);
|
data_json = self._html_search_regex(r'NYTD.FlexTypes.push\(({[^)]*)\)', webpage, 'json data')
|
||||||
if data_json is not None:
|
return self._extract_podcast_from_json(data_json, page_id, webpage)
|
||||||
return self._extract_podcast_from_json(data_json, page_id, webpage)
|
|
||||||
else:
|
|
||||||
raise UnsupportedError(url)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user