Browse Source

oauth token required for any content

pull/624/head
anxdpanic 5 months ago
parent
commit
2f6d09cb84
  1. 4
      README.md
  2. 1
      addon.xml
  3. 1
      changelog.txt
  4. 6
      resources/language/resource.language.en_gb/strings.po
  5. 2
      resources/lib/twitch_addon/addon/strings.py
  6. 53
      resources/lib/twitch_addon/routes/main.py

4
README.md

@ -29,10 +29,6 @@ FAQ
> The Add-on does however provide Quality Options which may help if your internet connection / computer specs are below requirements for HD streams.
> Try making sure that the Kodi Add-on "InputStream Adaptive" is installed, and Adaptive Quality is enabled in Twitch.tv's Add-on settings.
* Which features require an OAuth token?
> Live Notifications, Following (all menus), Follow/Unfollow, Subscriber only content, IRC (Chat)
What's next?
----------------

1
addon.xml

@ -19,6 +19,7 @@
[update] Update Twitch API usage from v5 to Helix
- This change will require you to generate a new oauth token from the add-on settings
- Some favorites may need to be recreated
- This change requires an OAuth token for access to any content
[add] Add to queue context menu item
[rem] Blacklisting of content
[lang] updated translations from Weblate

1
changelog.txt

@ -2,6 +2,7 @@
[update] Update Twitch API usage from v5 to Helix
- This change will require you to generate a new oauth token from the add-on settings
- Some favorites may need to be recreated
- This change requires an OAuth token for access to any content
[add] Add to queue context menu item
[rem] Blacklisting of content
[lang] updated translations from Weblate

6
resources/language/resource.language.en_gb/strings.po

@ -451,7 +451,7 @@ msgid "No results returned"
msgstr ""
msgctxt "#30132"
msgid "OAuth token is required for access to authorized user functions."
msgid "OAuth token is required for access"
msgstr ""
msgctxt "#30133"
@ -977,3 +977,7 @@ msgstr ""
msgctxt "#30266"
msgid "Add to queue"
msgstr ""
msgctxt "#30267"
msgid "An OAuth token is required for access, go to '%s' - '%s' - '%s' to generate one"
msgstr ""

2
resources/lib/twitch_addon/addon/strings.py

@ -133,4 +133,6 @@ STRINGS = {
'Follow': 30264,
'Unfollow': 30265,
'Add_to_queue': 30266,
'oauth_heading': 30132,
'oauth_message': 30267,
}

53
resources/lib/twitch_addon/routes/main.py

@ -20,16 +20,21 @@ def route(api):
has_token = True if api.access_token else False
kodi.set_view('files', set_sort=False)
show_menu = utils.show_menu
if show_menu('live', 'browse'):
context_menu = list()
kodi.create_item({'label': i18n('live_channels'), 'path': {'mode': MODES.STREAMLIST, 'stream_type': StreamType.LIVE},
'context_menu': context_menu, 'info': {'plot': '%s - %s' % (i18n('browse'), i18n('live_channels'))}, 'thumbfile': 'Live_Channels.png'})
if show_menu('games', 'browse'):
kodi.create_item({'label': i18n('games'), 'path': {'mode': MODES.GAMES},
'info': {'plot': '%s - %s' % (i18n('browse'), i18n('games'))}, 'thumbfile': 'Games.png'})
if not has_token:
_ = kodi.Dialog().ok(
i18n('oauth_heading'),
i18n('oauth_message') % (i18n('settings'), i18n('login'), i18n('get_oauth_token'))
)
if has_token:
if show_menu('live', 'browse'):
context_menu = list()
kodi.create_item({'label': i18n('live_channels'), 'path': {'mode': MODES.STREAMLIST, 'stream_type': StreamType.LIVE},
'context_menu': context_menu, 'info': {'plot': '%s - %s' % (i18n('browse'), i18n('live_channels'))}, 'thumbfile': 'Live_Channels.png'})
if show_menu('games', 'browse'):
kodi.create_item({'label': i18n('games'), 'path': {'mode': MODES.GAMES},
'info': {'plot': '%s - %s' % (i18n('browse'), i18n('games'))}, 'thumbfile': 'Games.png'})
if show_menu('live', 'following'):
context_menu = list()
kodi.create_item(
@ -47,21 +52,23 @@ def route(api):
if show_menu('following'):
kodi.create_item({'label': i18n('following'), 'path': {'mode': MODES.FOLLOWING}, 'info': {'plot': i18n('following')}, 'thumbfile': 'Following.png'})
if show_menu('streams', 'search'):
context_menu = list()
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('streams')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'streams'}, 'context_menu': context_menu,
'info': {'plot': '%s - %s' % (i18n('search'), i18n('streams'))}, 'thumbfile': 'Streams.png'})
if show_menu('channels', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('channels')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'channels'},
'info': {'plot': '%s - %s' % (i18n('search'), i18n('channels'))}, 'thumbfile': 'Channels.png'})
if show_menu('games', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('games')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'games'},
'info': {'plot': '%s - %s' % (i18n('search'), i18n('games'))}, 'thumbfile': 'Games.png'})
if show_menu('url', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('video_id_url')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'id_url'},
'info': {'plot': '%s - %s[CR]%s' % (i18n('search'), i18n('video_id_url'), i18n('search_id_url_description'))}, 'thumbfile': 'Video_Url.png'})
if show_menu('search'):
kodi.create_item({'label': i18n('search'), 'path': {'mode': MODES.SEARCH}, 'info': {'plot': i18n('search')}, 'thumbfile': 'Search.png'})
if show_menu('streams', 'search'):
context_menu = list()
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('streams')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'streams'}, 'context_menu': context_menu,
'info': {'plot': '%s - %s' % (i18n('search'), i18n('streams'))}, 'thumbfile': 'Streams.png'})
if show_menu('channels', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('channels')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'channels'},
'info': {'plot': '%s - %s' % (i18n('search'), i18n('channels'))}, 'thumbfile': 'Channels.png'})
if show_menu('games', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('games')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'games'},
'info': {'plot': '%s - %s' % (i18n('search'), i18n('games'))}, 'thumbfile': 'Games.png'})
if show_menu('url', 'search'):
kodi.create_item({'label': '%s %s' % (i18n('search'), i18n('video_id_url')), 'path': {'mode': MODES.NEWSEARCH, 'content': 'id_url'},
'info': {'plot': '%s - %s[CR]%s' % (i18n('search'), i18n('video_id_url'), i18n('search_id_url_description'))}, 'thumbfile': 'Video_Url.png'})
if show_menu('search'):
kodi.create_item({'label': i18n('search'), 'path': {'mode': MODES.SEARCH}, 'info': {'plot': i18n('search')}, 'thumbfile': 'Search.png'})
if show_menu('settings'):
kodi.create_item({'label': i18n('settings'), 'path': {'mode': MODES.SETTINGS}, 'info': {'plot': i18n('settings')}, 'is_folder': False, 'is_playable': False, 'thumbfile': 'Settings.png'})
kodi.end_of_directory(cache_to_disc=False)

Loading…
Cancel
Save