From b3b99187569451f3bacf69363df6dc65dfbf39da Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Mon, 1 Apr 2024 07:49:03 +1100 Subject: [PATCH] Update android client payload params - From LuanRT/YouTube.js#624 --- .../youtube/client/request_client.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/lib/youtube_plugin/youtube/client/request_client.py b/resources/lib/youtube_plugin/youtube/client/request_client.py index 808a05e5b..3f5de4c02 100644 --- a/resources/lib/youtube_plugin/youtube/client/request_client.py +++ b/resources/lib/youtube_plugin/youtube/client/request_client.py @@ -15,6 +15,11 @@ class YouTubeRequestClient(BaseRequestsClass): + _ANDROID_PARAMS = 'CgIIAdgDAQ==', + # yt-dlp has chosen the following value, but this results in the android + # player response not including adaptive formats + # _ANDROID_PARAMS = 'CgIIAQ==', + CLIENTS = { # 4k no VP9 HDR # Limited subtitle availability @@ -22,7 +27,7 @@ class YouTubeRequestClient(BaseRequestsClass): '_id': 30, '_query_subtitles': True, 'json': { - 'params': '2AMBCgIQBg', + 'params': _ANDROID_PARAMS, 'context': { 'client': { 'clientName': 'ANDROID_TESTSUITE', @@ -51,7 +56,10 @@ class YouTubeRequestClient(BaseRequestsClass): '_id': 3, '_query_subtitles': True, 'json': { - 'params': '2AMBCgIQBg', + 'params': _ANDROID_PARAMS, + # yt-dlp has chosen the following value, but this results in the + # player response not including adaptive formats + # 'params': 'CgIIAQ==', 'context': { 'client': { 'clientName': 'ANDROID', @@ -82,7 +90,7 @@ class YouTubeRequestClient(BaseRequestsClass): '_id': 55, '_query_subtitles': True, 'json': { - 'params': '2AMBCgIQBg', + 'params': _ANDROID_PARAMS, 'context': { 'client': { 'clientName': 'ANDROID_EMBEDDED_PLAYER', @@ -118,7 +126,7 @@ class YouTubeRequestClient(BaseRequestsClass): '_id': 29, '_query_subtitles': True, 'json': { - 'params': '2AMBCgIQBg', + 'params': _ANDROID_PARAMS, 'context': { 'client': { 'clientName': 'ANDROID_UNPLUGGED',