From 02e343f6ef6d7b3f9087ff69e4a1db0b4b4a5c5d Mon Sep 17 00:00:00 2001 From: Danish Humair Date: Mon, 29 Jan 2024 02:23:52 +0500 Subject: [PATCH] [ie/MedalTV] Fix extraction (#9098) Closes #8766 Authored by: Danish-H --- yt_dlp/extractor/medaltv.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/medaltv.py b/yt_dlp/extractor/medaltv.py index 9e57ee21a..eeb5b85f3 100644 --- a/yt_dlp/extractor/medaltv.py +++ b/yt_dlp/extractor/medaltv.py @@ -8,7 +8,8 @@ from ..utils import ( float_or_none, int_or_none, str_or_none, - traverse_obj + traverse_obj, + update_url_query, ) @@ -16,7 +17,7 @@ class MedalTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?medal\.tv/games/[^/?#&]+/clips/(?P[^/?#&]+)' _TESTS = [{ 'url': 'https://medal.tv/games/valorant/clips/jTBFnLKdLy15K', - 'md5': '6930f8972914b6b9fdc2bb3918098ba0', + 'md5': '03e4911fdcf7fce563090705c2e79267', 'info_dict': { 'id': 'jTBFnLKdLy15K', 'ext': 'mp4', @@ -33,8 +34,8 @@ class MedalTVIE(InfoExtractor): 'duration': 13, } }, { - 'url': 'https://medal.tv/games/cod%20cold%20war/clips/2mA60jWAGQCBH', - 'md5': '3d19d426fe0b2d91c26e412684e66a06', + 'url': 'https://medal.tv/games/cod-cold-war/clips/2mA60jWAGQCBH', + 'md5': 'fc7a3e4552ae8993c1c4006db46be447', 'info_dict': { 'id': '2mA60jWAGQCBH', 'ext': 'mp4', @@ -52,7 +53,7 @@ class MedalTVIE(InfoExtractor): 'duration': 23, } }, { - 'url': 'https://medal.tv/games/cod%20cold%20war/clips/2um24TWdty0NA', + 'url': 'https://medal.tv/games/cod-cold-war/clips/2um24TWdty0NA', 'md5': 'b6dc76b78195fff0b4f8bf4a33ec2148', 'info_dict': { 'id': '2um24TWdty0NA', @@ -81,7 +82,7 @@ class MedalTVIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) + webpage = self._download_webpage(update_url_query(url, {'mobilebypass': 'true'}), video_id) hydration_data = self._search_json( r']*>[^<]*\bhydrationData\s*=', webpage,