aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-09-03 01:24:20 +0700
committerSergey M․ <dstftw@gmail.com>2019-09-03 01:24:20 +0700
commit31dbd054c801ec14c1ea29a2167b70c980f1d782 (patch)
treee5e655e85dd9158e42ecd6ef04b40a8ab7d288c0
parent66d04c74e097c03e4d644d7292546884cbee3d2b (diff)
downloadyoutube-dl-31dbd054c801ec14c1ea29a2167b70c980f1d782.tar.xz
[platzi] Improve client data extraction (closes #22290)
-rw-r--r--youtube_dl/extractor/platzi.py6
1 files changed, 5 insertions, 1 deletions
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']