[nytimes] json regexp cleanup

Escape dots: \.
Favor
  \(({.*})\);
over
  \(({[^)]*)\)
in case there are internal close parens in the json data.
This commit is contained in:
John Hawkinson 2016-10-15 17:32:03 -04:00
parent 001a30f335
commit 804629ecb9

View File

@ -209,5 +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')
data_json = self._html_search_regex(r'NYTD\.FlexTypes\.push\(({.*})\);', webpage, 'json data')
return self._extract_podcast_from_json(data_json, page_id, webpage)