From: Sergey M․ Date: Mon, 2 Sep 2019 18:24:20 +0000 (+0700) Subject: [platzi] Improve client data extraction (closes #22290) X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=31dbd054c801ec14c1ea29a2167b70c980f1d782;p=youtube-dl.git [platzi] Improve client data extraction (closes #22290) --- diff --git a/youtube_dl/extractor/platzi.py b/youtube_dl/extractor/platzi.py index cd6b966c5..602207beb 100644 --- a/youtube_dl/extractor/platzi.py +++ b/youtube_dl/extractor/platzi.py @@ -107,7 +107,11 @@ class PlatziIE(PlatziBaseIE): data = self._parse_json( self._search_regex( - r'client_data\s*=\s*({.+?})\s*;', webpage, 'client data'), + # client_data may contain "};" so that we have to try more + # strict regex first + (r'client_data\s*=\s*({.+?})\s*;\s*\n', + r'client_data\s*=\s*({.+?})\s*;'), + webpage, 'client data'), lecture_id) material = data['initialState']['material']