From ebf0cb49865e171b84670a437303d298215b4580 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Fri, 3 May 2024 11:10:08 +1000 Subject: [PATCH 1/2] Disable android player request client by default #737 --- .../youtube/client/request_client.py | 14 +++++++++++--- .../youtube_plugin/youtube/helper/video_info.py | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/lib/youtube_plugin/youtube/client/request_client.py b/resources/lib/youtube_plugin/youtube/client/request_client.py index 0c00debdb..3b5b931e1 100644 --- a/resources/lib/youtube_plugin/youtube/client/request_client.py +++ b/resources/lib/youtube_plugin/youtube/client/request_client.py @@ -60,6 +60,7 @@ class YouTubeRequestClient(BaseRequestsClass): }, 'android': { '_id': 3, + '_disabled': True, '_query_subtitles': 'optional', 'json': { 'context': { @@ -343,11 +344,18 @@ def json_traverse(cls, json_data, path, default=None): return result @classmethod - def build_client(cls, client_name, data=None): + def build_client(cls, client_name=None, data=None): templates = {} - client = (cls.CLIENTS.get(client_name) - or YouTubeRequestClient.CLIENTS['web']).copy() + client = None + if client_name: + client = cls.CLIENTS.get(client_name) + if client and client.get('_disabled'): + return None + if not client: + client = YouTubeRequestClient.CLIENTS['web'] + client = client.copy() + if data: client = merge_dicts(client, data) client = merge_dicts(cls.CLIENTS['_common'], client, templates) diff --git a/resources/lib/youtube_plugin/youtube/helper/video_info.py b/resources/lib/youtube_plugin/youtube/helper/video_info.py index 28cea1343..71fd3fdf1 100644 --- a/resources/lib/youtube_plugin/youtube/helper/video_info.py +++ b/resources/lib/youtube_plugin/youtube/helper/video_info.py @@ -1166,6 +1166,8 @@ def _get_video_info(self): ) ) client = self.build_client(client_name, client_data) + if not client: + continue result = self.request( video_info_url, @@ -1420,6 +1422,8 @@ def _get_video_info(self): and subtitles.sub_selection == subtitles.LANG_ALL)): for client_name in ('smarttv_embedded', 'web', 'android'): caption_client = self.build_client(client_name, client_data) + if not caption_client: + continue result = self.request( video_info_url, 'POST', From 90a15d0ffa709de6d93ef3192a57ffcf300c614d Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Fri, 3 May 2024 18:07:22 +1000 Subject: [PATCH 2/2] Version bump v7.0.6.3 --- addon.xml | 2 +- changelog.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 49d83f0b0..9c119eca5 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index d8e3d5cd6..4c331c6a7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,4 @@ -## v7.0.6.2 +## v7.0.6.3 ### Fixed - Improve updating containers and (re)loading windows #681 - Fix refreshing video listing also forcing next pages to refresh when loaded @@ -9,6 +9,7 @@ - Update error checks to avoid unnecessary retries of player requests - Fix adding and viewing items to internal bookmarks and watchlater list #720 - Fix error checks to prevent prematurely stopping retries of player requests #730 +- Disable using android client player request by default #737 ### Changed - Setup Wizard default settings now disable pre-downloading subtitles if MPEG-DASH is enabled