From 804629ecb9296b08e0052307441b7a1c368b07a7 Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sat, 15 Oct 2016 17:32:03 -0400 Subject: [PATCH] [nytimes] json regexp cleanup Escape dots: \. Favor \(({.*})\); over \(({[^)]*)\) in case there are internal close parens in the json data. --- youtube_dl/extractor/nytimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/nytimes.py b/youtube_dl/extractor/nytimes.py index d1579a2be..c69f40412 100644 --- a/youtube_dl/extractor/nytimes.py +++ b/youtube_dl/extractor/nytimes.py @@ -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)