aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/mtv.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/mtv.py')
-rw-r--r--yt_dlp/extractor/mtv.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yt_dlp/extractor/mtv.py b/yt_dlp/extractor/mtv.py
index 4cf178b04..510f1439e 100644
--- a/yt_dlp/extractor/mtv.py
+++ b/yt_dlp/extractor/mtv.py
@@ -275,7 +275,9 @@ class MTVServicesInfoExtractor(InfoExtractor):
@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 @@ class MTVServicesInfoExtractor(InfoExtractor):
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