From a2e0e472260b34c52dbf5d5d4d4219d565ecd2ac Mon Sep 17 00:00:00 2001 From: DTrombett Date: Sun, 22 Dec 2024 19:25:56 +0100 Subject: [PATCH] Remove hard coded values --- yt_dlp/extractor/plutotv.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/plutotv.py b/yt_dlp/extractor/plutotv.py index a3035dabe8..c87ac06a07 100644 --- a/yt_dlp/extractor/plutotv.py +++ b/yt_dlp/extractor/plutotv.py @@ -220,9 +220,23 @@ class PlutoTVLiveIE(InfoExtractor): }, }] + def _build_start_query(self, slug): + return { + 'appName': 'web', + 'appVersion': 'na', + 'clientID': str(uuid.uuid1()), + 'clientModelNumber': 'na', + 'serverSideAds': 'false', + 'deviceMake': 'unknown', + 'deviceModel': 'web', + 'deviceType': 'web', + 'deviceVersion': 'unknown', + 'channelSlug': slug, + } + def _real_extract(self, url): slug = self._match_id(url) - start = self._download_json('https://boot.pluto.tv/v4/start?appName=web&appVersion=10.0.0&clientID=88eb6ea8-2fcd-4e69-8caa-f543a79e509a&clientModelNumber=1.0.0&serverSideAds=false&deviceVersion=132.0.0&deviceModel=web&deviceMake=chrome&deviceType=web&channelSlug=' + slug, slug, 'Downloading info json') + start = self._download_json('https://boot.pluto.tv/v4/start', slug, 'Downloading info json', query=self._build_start_query(slug)) channel = start['EPG'][0] program = channel['timelines'][0] formats, subtitles = self._extract_m3u8_formats_and_subtitles(start['servers']['stitcher'] + '/v2' + channel['stitched']['path'] + '?' + start['stitcherParams'] + '&jwt=' + start['sessionToken'], channel['id'])