From e307a467c49e69b8606ce1ac0dcd0d6e6263cddd Mon Sep 17 00:00:00 2001 From: Henry Qin Date: Fri, 15 Aug 2025 20:07:00 -0700 Subject: [PATCH 1/2] [mgtv] Use a different URL when cookies are present. Previously, the mgtv extractor used the same URL when cookies are present vs active. Unfortunately, that URL always downloads only the first five minutes of a video, even when cookies would allow viewing the entire video. This commit updates the extractor to use a different URL when cookies are offered, to allow downloading full videos when the proper credentials are given in cookies. --- yt_dlp/extractor/mgtv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/mgtv.py b/yt_dlp/extractor/mgtv.py index c793626fde..65cc625e99 100644 --- a/yt_dlp/extractor/mgtv.py +++ b/yt_dlp/extractor/mgtv.py @@ -93,8 +93,11 @@ class MGTVIE(InfoExtractor): raise ExtractorError(error['msg'], expected=True) raise + url = 'https://pcweb.api.mgtv.com/player/getSource' + if self._get_cookies('https://mgtv.com'): + url = 'https://tinker.glb.mgtv.com/player/getSource' stream_data = self._download_json( - 'https://pcweb.api.mgtv.com/player/getSource', video_id, query={ + url, video_id, query={ 'tk2': tk2, 'pm2': api_data['atc']['pm2'], 'video_id': video_id, From 9d72a21c077cdc4301cb352d85209cd6e959a9b9 Mon Sep 17 00:00:00 2001 From: Henry Qin Date: Sat, 11 Oct 2025 17:09:12 -0700 Subject: [PATCH 2/2] Change url to api_url. --- yt_dlp/extractor/mgtv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/mgtv.py b/yt_dlp/extractor/mgtv.py index 65cc625e99..dbece1f307 100644 --- a/yt_dlp/extractor/mgtv.py +++ b/yt_dlp/extractor/mgtv.py @@ -93,11 +93,11 @@ class MGTVIE(InfoExtractor): raise ExtractorError(error['msg'], expected=True) raise - url = 'https://pcweb.api.mgtv.com/player/getSource' + api_url = 'https://pcweb.api.mgtv.com/player/getSource' if self._get_cookies('https://mgtv.com'): - url = 'https://tinker.glb.mgtv.com/player/getSource' + api_url = 'https://tinker.glb.mgtv.com/player/getSource' stream_data = self._download_json( - url, video_id, query={ + api_url, video_id, query={ 'tk2': tk2, 'pm2': api_data['atc']['pm2'], 'video_id': video_id,