]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/mtv.py
Update to ytdl-commit-4fb25ff
[yt-dlp.git] / yt_dlp / extractor / mtv.py
index 4cf178b04a9296508e7125f156b0d8c01a8e125f..510f1439e5a7e618ff619a9a770db892f6edae03 100644 (file)
@@ -275,7 +275,9 @@ def _extract_triforce_mgid(self, webpage, data_zone=None, video_id=None):
 
     @staticmethod
     def _extract_child_with_type(parent, t):
-        return next(c for c in parent['children'] if c.get('type') == t)
+        for c in parent['children']:
+            if c.get('type') == t:
+                return c
 
     def _extract_mgid(self, webpage):
         try:
@@ -306,7 +308,8 @@ def _extract_mgid(self, webpage):
             data = self._parse_json(self._search_regex(
                 r'__DATA__\s*=\s*({.+?});', webpage, 'data'), None)
             main_container = self._extract_child_with_type(data, 'MainContainer')
-            video_player = self._extract_child_with_type(main_container, 'VideoPlayer')
+            ab_testing = self._extract_child_with_type(main_container, 'ABTesting')
+            video_player = self._extract_child_with_type(ab_testing or main_container, 'VideoPlayer')
             mgid = video_player['props']['media']['video']['config']['uri']
 
         return mgid