From b901b6a08bcba71ce1efe7652def534f5c51879b Mon Sep 17 00:00:00 2001 From: Aakash Gajjar Date: Tue, 24 Dec 2019 11:39:43 +0530 Subject: [PATCH] [tiktok] fix json_string extraction --- youtube_dl/extractor/tiktok.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/tiktok.py b/youtube_dl/extractor/tiktok.py index 539fc9ecda..185b66eb64 100644 --- a/youtube_dl/extractor/tiktok.py +++ b/youtube_dl/extractor/tiktok.py @@ -239,7 +239,7 @@ class TikTokIE(TikTokBaseIE): } webpage = self._download_webpage(url, video_id, headers=headers, note='Downloading video webpage') json_string = self._search_regex( - r'id=\"__NEXT_DATA__\"\s+type=\"application\/json\">\s*(?P[^<]+)', + r'id=\"__NEXT_DATA__\"\s+type=\"application\/json\"\s*[^>]+>\s*(?P[^<]+)', webpage, 'json_string', group='json_string') json_data = self._parse_json(json_string, video_id) video_data = try_get(json_data, lambda x: x['props']['pageProps'], expected_type=dict)