diff --git a/addon.xml b/addon.xml index 2796a91c8..1478c0942 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index 392836642..54f8e5a7c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index a0a47974e..71acf1b8e 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -43,11 +43,11 @@ msgid "General" msgstr "" msgctxt "#30001" -msgid "Username" +msgid "" msgstr "" msgctxt "#30002" -msgid "Password" +msgid "" msgstr "" msgctxt "#30003" @@ -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" @@ -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" @@ -224,7 +224,7 @@ msgid "Remove" msgstr "" msgctxt "#30109" -msgid "Latest Videos" +msgid "" msgstr "" msgctxt "#30110" @@ -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 @@ -378,7 +378,7 @@ msgid "Subscribe to %s" msgstr "" msgctxt "#30518" -msgid "Go to '%s'" +msgid "" msgstr "" msgctxt "#30519" @@ -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" @@ -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" @@ -758,11 +758,11 @@ 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" @@ -770,15 +770,15 @@ 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" @@ -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" @@ -802,7 +802,7 @@ msgid "Install InputStream Helper" msgstr "" msgctxt "#30624" -msgid "Requires Kodi 17+" +msgid "" msgstr "" msgctxt "#30625" @@ -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" @@ -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" @@ -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" @@ -1190,7 +1190,7 @@ msgid "Unsubscribed from channel" msgstr "" msgctxt "#30721" -msgid "Default to WEBM adaptation set (4K)" +msgid "" msgstr "" msgctxt "#30722" @@ -1198,7 +1198,7 @@ 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" @@ -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 "" diff --git a/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py b/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py index b9741e577..21a69b45e 100644 --- a/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py +++ b/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, } diff --git a/resources/lib/youtube_plugin/kodion/script_actions.py b/resources/lib/youtube_plugin/kodion/script_actions.py index f3234bd50..88c85a3f3 100644 --- a/resources/lib/youtube_plugin/kodion/script_actions.py +++ b/resources/lib/youtube_plugin/kodion/script_actions.py @@ -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): @@ -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 = { diff --git a/resources/lib/youtube_plugin/youtube/client/request_client.py b/resources/lib/youtube_plugin/youtube/client/request_client.py index 2279dc63d..bf1fb5159 100644 --- a/resources/lib/youtube_plugin/youtube/client/request_client.py +++ b/resources/lib/youtube_plugin/youtube/client/request_client.py @@ -264,7 +264,7 @@ class YouTubeRequestClient(BaseRequestsClass): 'Authorization': 'Bearer {_access_token}', }, 'params': { - 'key': None, + 'key': ValueError, 'prettyPrint': 'false' }, }, @@ -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 diff --git a/resources/lib/youtube_plugin/youtube/client/youtube.py b/resources/lib/youtube_plugin/youtube/client/youtube.py index 176ecb6dc..8295d2a16 100644 --- a/resources/lib/youtube_plugin/youtube/client/youtube.py +++ b/resources/lib/youtube_plugin/youtube/client/youtube.py @@ -113,6 +113,7 @@ class YouTube(LoginClient): ' Chrome/80.0.3987.162 Mobile Safari/537.36'), }, 'params': { + 'key': None, 'prettyPrint': 'false' }, }, diff --git a/resources/lib/youtube_plugin/youtube/helper/stream_info.py b/resources/lib/youtube_plugin/youtube/helper/stream_info.py index 8d92dfd3c..9bf25f1bc 100644 --- a/resources/lib/youtube_plugin/youtube/helper/stream_info.py +++ b/resources/lib/youtube_plugin/youtube/helper/stream_info.py @@ -1820,8 +1820,8 @@ def _process_stream_data(self, stream_data, default_lang_code='und'): language = audio_track.get('id', default_lang_code) if '.' in language: - language_code, role_type = language.split('.') - role_type = int(role_type) + language_code, role_str = language.split('.') + role_type = int(role_str) else: language_code = language role_type = 4 @@ -1842,7 +1842,7 @@ def _process_stream_data(self, stream_data, default_lang_code='und'): label = self._context.localize('stream.alternate') mime_group = ''.join(( - mime_type, '_', language_code, '.', role_type, + mime_type, '_', language_code, '.', role_str, )) if language_code == self._language_base and ( not preferred_audio['id'] @@ -1850,7 +1850,7 @@ def _process_stream_data(self, stream_data, default_lang_code='und'): or role_type > preferred_audio['role_type'] ): preferred_audio = { - 'id': ''.join(('_', language_code, '.', role_type)), + 'id': ''.join(('_', language_code, '.', role_str)), 'language_code': language_code, 'role_type': role_type, } @@ -1868,7 +1868,7 @@ def _process_stream_data(self, stream_data, default_lang_code='und'): if channels > 2 or 'auto' not in stream_select: quality_group = ''.join(( container, '_', codec, '_', language_code, - '.', role_type, + '.', role_str, )) else: quality_group = mime_group diff --git a/resources/settings.xml b/resources/settings.xml index cb6b23b2b..d01bd58dc 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -1125,7 +1125,6 @@ - 0 @@ -1137,6 +1136,16 @@ true + + 0 + + true + + RunScript($ID,maintenance/refresh?target=settings_xml) + + true + +