Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0.9+beta.8 #858

Merged
merged 5 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9+beta.7" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.0.9+beta.8" 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
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v7.0.9+beta.8
### Fixed
- Fix API requests failing if not logged in
- Fix multi-audio streams failing to play

### New
- Add script action to refresh settings
- Settings > Maintenance > Refresh settings.xml
- Will remove unused settings from settings.xml to stop log spam

## v7.0.9+beta.7
### New
- Improve use of progressive streams
Expand Down
72 changes: 40 additions & 32 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ msgid "General"
msgstr ""

msgctxt "#30001"
msgid "Username"
msgid ""
msgstr ""

msgctxt "#30002"
msgid "Password"
msgid ""
msgstr ""

msgctxt "#30003"
Expand All @@ -57,11 +57,11 @@ msgstr ""
# empty strings from id 30004 to 30006

msgctxt "#30007"
msgid "Use InputStream Adaptive"
msgid "Use InputStream.Adaptive"
msgstr ""

msgctxt "#30008"
msgid "Configure InputStream Adaptive"
msgid "Configure InputStream.Adaptive"
msgstr ""

msgctxt "#30009"
Expand Down Expand Up @@ -200,15 +200,15 @@ msgid "Search"
msgstr ""

msgctxt "#30103"
msgid "Library"
msgid ""
msgstr ""

msgctxt "#30104"
msgid "Highlights"
msgid ""
msgstr ""

msgctxt "#30105"
msgid "Archive"
msgid ""
msgstr ""

msgctxt "#30106"
Expand All @@ -224,7 +224,7 @@ msgid "Remove"
msgstr ""

msgctxt "#30109"
msgid "Latest Videos"
msgid ""
msgstr ""

msgctxt "#30110"
Expand Down Expand Up @@ -295,11 +295,11 @@ msgid "API Secret"
msgstr ""

msgctxt "#30204"
msgid "Enable personal API keys"
msgid ""
msgstr ""

msgctxt "#30205"
msgid "Use preset API key set"
msgid ""
msgstr ""

# YouTube
Expand Down Expand Up @@ -378,7 +378,7 @@ msgid "Subscribe to %s"
msgstr ""

msgctxt "#30518"
msgid "Go to '%s'"
msgid ""
msgstr ""

msgctxt "#30519"
Expand Down Expand Up @@ -554,19 +554,19 @@ msgid "None"
msgstr ""

msgctxt "#30562"
msgid "All"
msgid ""
msgstr ""

msgctxt "#30563"
msgid "Setting"
msgid ""
msgstr ""

msgctxt "#30564"
msgid "Setting, English"
msgid ""
msgstr ""

msgctxt "#30565"
msgid "English"
msgid ""
msgstr ""

msgctxt "#30566"
Expand Down Expand Up @@ -622,7 +622,7 @@ msgid "Force SSL certificate verification"
msgstr ""

msgctxt "#30579"
msgid "InputStream Adaptive is activated in the YouTube settings, however the add-on has been disabled. Would you like to enable InputStream Adaptive now?"
msgid "InputStream.Adaptive is activated in the YouTube settings, however the add-on has been disabled. Would you like to enable InputStream.Adaptive now?"
msgstr ""

msgctxt "#30580"
Expand Down Expand Up @@ -758,27 +758,27 @@ msgid "Retry"
msgstr ""

msgctxt "#30613"
msgid "Retrieve Watch Later playlist id"
msgid ""
msgstr ""

msgctxt "#30614"
msgid "Failed to retrieve Watch Later playlist id. Add a few videos to Watch Later via the web/app and retry."
msgid ""
msgstr ""

msgctxt "#30615"
msgid "Cancel"
msgstr ""

msgctxt "#30616"
msgid "Must be signed in."
msgid ""
msgstr ""

msgctxt "#30617"
msgid "InputStream Adaptive"
msgid "InputStream.Adaptive"
msgstr ""

msgctxt "#30618"
msgid "Enable MPEG-DASH proxy"
msgid ""
msgstr ""

msgctxt "#30619"
Expand All @@ -790,7 +790,7 @@ msgid "Port %s already in use. Cannot start http server."
msgstr ""

msgctxt "#30621"
msgid "Proxy is required for MPEG-DASH VODs (see Advanced > HTTP Server)"
msgid ""
msgstr ""

msgctxt "#30622"
Expand All @@ -802,7 +802,7 @@ msgid "Install InputStream Helper"
msgstr ""

msgctxt "#30624"
msgid "Requires Kodi 17+"
msgid ""
msgstr ""

msgctxt "#30625"
Expand Down Expand Up @@ -898,15 +898,15 @@ msgid "Completed Live"
msgstr ""

msgctxt "#30648"
msgid "API Key is incorrect. Settings - API - API Key"
msgid "API Key is incorrect. Settings > API > API Key"
msgstr ""

msgctxt "#30649"
msgid "Client Id is incorrect. Settings - API - API Id"
msgid "Client Id is incorrect. Settings > API > API Id"
msgstr ""

msgctxt "#30650"
msgid "Client Secret is incorrect. Settings - API - API Secret"
msgid "Client Secret is incorrect. Settings > API > API Secret"
msgstr ""

msgctxt "#30651"
Expand Down Expand Up @@ -1066,7 +1066,7 @@ msgid "Use for live streams"
msgstr ""

msgctxt "#30690"
msgid "InputStream Adaptive >= 2.0.12 is required for adaptive live streams"
msgid "InputStream.Adaptive >= 2.0.12 is required for adaptive live streams"
msgstr ""

msgctxt "#30691"
Expand Down Expand Up @@ -1142,15 +1142,15 @@ msgid "Play audio only"
msgstr ""

msgctxt "#30709"
msgid "Failed to retrieve Watch Later playlist id. To increase the chances of retrieval add 8-10 videos to Watch Later via the web/app and retry."
msgid ""
msgstr ""

msgctxt "#30710"
msgid "Failed to retrieve Watch Later playlist id. Try again tomorrow without removing any of the videos."
msgid ""
msgstr ""

msgctxt "#30711"
msgid "Searching for Watch Later... Page %s"
msgid ""
msgstr ""

msgctxt "#30712"
Expand Down Expand Up @@ -1190,15 +1190,15 @@ msgid "Unsubscribed from channel"
msgstr ""

msgctxt "#30721"
msgid "Default to WEBM adaptation set (4K)"
msgid ""
msgstr ""

msgctxt "#30722"
msgid "Enable HDR video"
msgstr ""

msgctxt "#30723"
msgid "Proxy is required for MPEG-DASH VODs (see Advanced > HTTP Server)[CR]HDR and >1080p video requires InputStream Adaptive >= 2.3.14"
msgid "Proxy is required for MPEG-DASH VODs (see Advanced > HTTP Server)[CR]HDR and >1080p video requires InputStream.Adaptive >= 2.3.14"
msgstr ""

msgctxt "#30724"
Expand Down Expand Up @@ -1572,3 +1572,11 @@ msgstr ""
msgctxt "#30816"
msgid "List is empty.[CR][CR]Refresh from context menu or try again later."
msgstr ""

msgctxt "#30817"
msgid "Refresh settings.xml"
msgstr ""

msgctxt "#30818"
msgid "Are you sure you want to refresh settings.xml?"
msgstr ""
10 changes: 2 additions & 8 deletions resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ class XbmcContext(AbstractContext):
'error.no_video_streams_found': 30549,
'error.rtmpe_not_supported': 30542,
'failed': 30576,
'failed.watch_later.retry': 30614,
'failed.watch_later.retry.2': 30709,
'failed.watch_later.retry.3': 30710,
'go_to_channel': 30502,
'highlights': 30104,
'history': 30509,
'history.clear': 30609,
'history.clear.confirm': 30610,
Expand Down Expand Up @@ -133,7 +129,6 @@ class XbmcContext(AbstractContext):
'maintenance.playback_history': 30673,
'maintenance.search_history': 30558,
'maintenance.watch_later': 30782,
'must_be_signed_in': 30616,
'my_channel': 30507,
'my_location': 30654,
'my_subscriptions': 30510,
Expand Down Expand Up @@ -164,12 +159,12 @@ class XbmcContext(AbstractContext):
'purchases': 30622,
'recommendations': 30551,
'refresh': 30543,
'refresh.settings.confirm': 30818,
'related_videos': 30514,
'remove': 30108,
'removed': 30666,
'rename': 30113,
'renamed': 30667,
'requires.krypton': 30624,
'reset.access_manager.confirm': 30581,
'retry': 30612,
'saved.playlists': 30611,
Expand Down Expand Up @@ -207,7 +202,7 @@ class XbmcContext(AbstractContext):
'setup_wizard.prompt.settings.performance': 30785,
'setup_wizard.prompt.subtitles': 30600,
'sign.enter_code': 30519,
'sign.go_to': 30518,
'sign.go_to': 30502,
'sign.in': 30111,
'sign.out': 30112,
'sign.twice.text': 30547,
Expand Down Expand Up @@ -281,7 +276,6 @@ class XbmcContext(AbstractContext):
'watch_later.list.set': 30567,
'watch_later.list.set.confirm': 30570,
'watch_later.remove': 30108,
'watch_later.retrieval_page': 30711,
'youtube': 30003,
}

Expand Down
44 changes: 43 additions & 1 deletion resources/lib/youtube_plugin/kodion/script_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from .context import XbmcContext
from .network import get_client_ip_address, httpd_status
from .utils import rm_dir, validate_ip_address
from .utils import current_system_version, rm_dir, validate_ip_address


def _config_actions(context, action, *_args):
Expand Down Expand Up @@ -150,6 +150,48 @@ def _maintenance_actions(context, action, params):
targets[target]().clear()
ui.show_notification(localize('succeeded'))

elif action == 'refresh':
targets = {
'settings_xml': 'settings.xml',
}
path = targets.get(target)
if not path:
return

if target == 'settings_xml' and ui.on_yes_no_input(
context.get_name(), localize('refresh.settings.confirm')
):
if not current_system_version.compatible(20, 0):
ui.show_notification(localize('failed'))
return

import xml.etree.ElementTree as ET

path = xbmcvfs.translatePath(os.path.join(DATA_PATH, path))
xml = ET.parse(path)
settings = xml.getroot()

marker = settings.find('setting[@id="|end_settings_marker|"]')
if marker is None:
ui.show_notification(localize('failed'))
return

removed = 0
for setting in reversed(settings.findall('setting')):
if setting == marker:
break
settings.remove(setting)
removed += 1
else:
ui.show_notification(localize('failed'))
return

if removed:
xml.write(path)
ui.show_notification(localize('succeeded'))
else:
return

elif action == 'delete':
path = params.get('path')
targets = {
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/youtube_plugin/youtube/client/request_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class YouTubeRequestClient(BaseRequestsClass):
'Authorization': 'Bearer {_access_token}',
},
'params': {
'key': None,
'key': ValueError,
'prettyPrint': 'false'
},
},
Expand Down Expand Up @@ -360,7 +360,7 @@ def build_client(cls, client_name=None, data=None):
else:
if 'Authorization' in client['headers']:
del client['headers']['Authorization']
if 'key' in params and not params['key']:
if 'key' in params and params['key'] is ValueError:
del params['key']
except KeyError:
pass
Expand Down
1 change: 1 addition & 0 deletions resources/lib/youtube_plugin/youtube/client/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class YouTube(LoginClient):
' Chrome/80.0.3987.162 Mobile Safari/537.36'),
},
'params': {
'key': None,
'prettyPrint': 'false'
},
},
Expand Down
Loading
Loading