]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/stv.py
[extractor,cleanup] Use `_search_nextjs_data`
[yt-dlp.git] / yt_dlp / extractor / stv.py
index d36a4b6e9604c740ca6a2d98d76c90eadc4e5e0a..ba5661d7474613f340a3522f500ee2c5ecadaf4f 100644 (file)
@@ -45,10 +45,7 @@ def _real_extract(self, url):
         ptype, video_id = self._match_valid_url(url).groups()
 
         webpage = self._download_webpage(url, video_id, fatal=False) or ''
-        props = (self._parse_json(self._search_regex(
-            r'<script[^>]+id="__NEXT_DATA__"[^>]*>({.+?})</script>',
-            webpage, 'next data', default='{}'), video_id,
-            fatal=False) or {}).get('props') or {}
+        props = self._search_nextjs_data(webpage, video_id, default='{}').get('props') or {}
         player_api_cache = try_get(
             props, lambda x: x['initialReduxState']['playerApiCache']) or {}