Skip to content

Commit

Permalink
Merge pull request #743 from MoojMidge/v7.0.6
Browse files Browse the repository at this point in the history
v7.0.6.3
  • Loading branch information
MoojMidge committed May 3, 2024
2 parents cf4dd4c + 90a15d0 commit 6361f86
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="7.0.6.2" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.0.6.3" provider-name="anxdpanic, bromix, MoojMidge">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.27.1"/>
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
14 changes: 11 additions & 3 deletions resources/lib/youtube_plugin/youtube/client/request_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class YouTubeRequestClient(BaseRequestsClass):
},
'android': {
'_id': 3,
'_disabled': True,
'_query_subtitles': 'optional',
'json': {
'context': {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions resources/lib/youtube_plugin/youtube/helper/video_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 6361f86

Please sign in to comment.