From 6b48656488fb4e04efb9d4adcf82df55cdff0d24 Mon Sep 17 00:00:00 2001 From: HobbyistDev Date: Tue, 27 Sep 2022 21:33:56 +0900 Subject: [PATCH] [plex:app] shorten long line in media_json --- yt_dlp/extractor/plex.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/plex.py b/yt_dlp/extractor/plex.py index c4c6660652..f50b3d1fcc 100644 --- a/yt_dlp/extractor/plex.py +++ b/yt_dlp/extractor/plex.py @@ -434,8 +434,11 @@ class PlexAppIE(PlexWatchBaseIE): provider, key, display_id = self._match_valid_url(url).group('provider', 'key', 'id') key = urllib.parse.unquote(key) media_json = self._download_json( - f'{self._CDN_ENDPOINT[provider]}{key}', display_id, query={'uri': f'provider://{provider}{key}', 'X-Plex-Token': PlexWatchBaseIE._TOKEN}, - headers={'Accept': 'application/json'})['MediaContainer']['Metadata'][0] + f'{self._CDN_ENDPOINT[provider]}{key}', display_id, headers={'Accept': 'application/json'}, + query={ + 'uri': f'provider://{provider}{key}', + 'X-Plex-Token': PlexWatchBaseIE._TOKEN + })['MediaContainer']['Metadata'][0] # check if publicPagesURL, if exists redirect to PlexWatch*IE, else handle manually if media_json.get('publicPagesURL'):