Skip to content

Commit

Permalink
Version 0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco8 committed Jul 9, 2023
1 parent 88e25cb commit 4a5a55c
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 18 deletions.
14 changes: 7 additions & 7 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.skyott"
name="Skyott"
version="0.4.4"
name="SkyOtt"
version="0.4.7"
provider-name="Paco8">
<requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
Expand All @@ -16,12 +16,12 @@
<extension point="xbmc.service" library="service.py" />

<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Peacock/SkyShowtime</summary>
<description lang="en_GB">Watch Peacock TV and SkyShowtime in Kodi. Requires a subscription.</description>
<description lang="es_ES">Vea Peacock TV y SkyShowtime en Kodi. Se necesita estar abonado.</description>
<summary lang="en_GB">SkyShowtime / PeacockTV</summary>
<description lang="en_GB">Watch SkyShowtime or Peacock TV in Kodi. Requires a subscription.</description>
<description lang="es_ES">Vea SkyShowtime o Peacock TV en Kodi. Se necesita estar abonado.</description>
<description lang="pl_PL">Oglądaj Peacock TV i SkyShowtime w Kodi. Wymaga subskrypcji.</description>
<disclaimer lang="en_GB">This addon is not officially authorized or supported by Peacock or SkyShowtime. Any product names, logos, and trademarks mentioned in this project are the property of their respective owners.</disclaimer>
<disclaimer lang="es_ES">Este addon no está oficialmente autorizado ni respaldado por Peacock ni por SkyShowtime. Cualquier nombre de producto, logotipo y marca comercial mencionados en este proyecto son propiedad de sus respectivos propietarios.</disclaimer>
<disclaimer lang="en_GB">This addon is not officially authorized or supported by SkyShowtime nor Peacock TV. Any product names, logos, and trademarks mentioned in this project are the property of their respective owners.</disclaimer>
<disclaimer lang="es_ES">Este addon no está oficialmente autorizado ni respaldado por SkyShowtime ni Peacock TV. Cualquier nombre de producto, logotipo y marca comercial mencionados en este proyecto son propiedad de sus respectivos propietarios.</disclaimer>
<disclaimer lang="pl_PL">Ten dodatek nie jest oficjalnie autoryzowany ani wspierany przez Peacock lub SkyShowtime. Wszelkie nazwy produktów, loga i znaki handlowe wymienione w tym projekcie należą ich właścicieli.</disclaimer>
<platform>all</platform>
<license>LGPL-2.1-or-later</license>
Expand Down
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/fanart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ msgctxt "#30041"
msgid "Subscription country (two letter code):"
msgstr ""

# For SkyOTT only
msgctxt "#30050"
msgid "Remember username and password"
msgstr ""

msgctxt "#30101"
msgid "Menu"
msgstr ""
Expand Down Expand Up @@ -363,6 +368,18 @@ msgctxt "#30187"
msgid "Select the cookie file"
msgstr ""

msgctxt "#30190"
msgid "Login to {} with a key file"
msgstr ""

msgctxt "#30191"
msgid "Login to {} with username"
msgstr ""

msgctxt "#30192"
msgid "Use a {} account"
msgstr ""

msgctxt "#30200"
msgid "Error"
msgstr ""
Expand Down
19 changes: 18 additions & 1 deletion resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ msgctxt "#30041"
msgid "Subscription country (two letter code):"
msgstr "País de la suscripción (código de dos letras):"

# For SkyOTT only
msgctxt "#30050"
msgid "Remember username and password"
msgstr "Recordar usuario y clave"

msgctxt "#30101"
msgid "Menu"
msgstr "Menú"
Expand Down Expand Up @@ -340,6 +345,18 @@ msgctxt "#30187"
msgid "Select the cookie file"
msgstr "Selecciona el fichero cookie"

msgctxt "#30190"
msgid "Login to {} with a key file"
msgstr "Iniciar sesión en {} con fichero key"

msgctxt "#30191"
msgid "Login to {} with username"
msgstr "Iniciar sesión en {} con nombre y clave"

msgctxt "#30192"
msgid "Use a {} account"
msgstr "Usar una cuenta de {}"

msgctxt "#30200"
msgid "Error"
msgstr "Error"
Expand Down Expand Up @@ -392,7 +409,7 @@ msgstr "Opciones de IPTV Manager"
# For Orange and Movistar only
msgctxt "#30304"
msgid "IPTV"
msgstr ""
msgstr "IPTV"

msgctxt "#30305"
msgid "Export channels and EPG for IPTV automatically"
Expand Down
17 changes: 17 additions & 0 deletions resources/language/resource.language.hu_hu/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ msgctxt "#30041"
msgid "Subscription country (two letter code):"
msgstr "Előfizetés helye, ország (kétbetűs kód):"

# For SkyOTT only
msgctxt "#30050"
msgid "Remember username and password"
msgstr ""

msgctxt "#30101"
msgid "Menu"
msgstr "Menü"
Expand Down Expand Up @@ -363,6 +368,18 @@ msgctxt "#30187"
msgid "Select the cookie file"
msgstr "Cookie fájl kiválasztása"

msgctxt "#30190"
msgid "Login to {} with a key file"
msgstr ""

msgctxt "#30191"
msgid "Login to {} with username"
msgstr ""

msgctxt "#30192"
msgid "Use a {} account"
msgstr ""

msgctxt "#30200"
msgid "Error"
msgstr "Hiba"
Expand Down
17 changes: 17 additions & 0 deletions resources/language/resource.language.pl_pl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ msgctxt "#30041"
msgid "Subscription country (two letter code):"
msgstr "Kraj subskrypcji (kod dwuliterowy):"

# For SkyOTT only
msgctxt "#30050"
msgid "Remember username and password"
msgstr ""

msgctxt "#30101"
msgid "Menu"
msgstr "Menu"
Expand Down Expand Up @@ -363,6 +368,18 @@ msgctxt "#30187"
msgid "Select the cookie file"
msgstr "Wybierz plik cookie"

msgctxt "#30190"
msgid "Login to {} with a key file"
msgstr ""

msgctxt "#30191"
msgid "Login to {} with username"
msgstr ""

msgctxt "#30192"
msgid "Use a {} account"
msgstr ""

msgctxt "#30200"
msgid "Error"
msgstr "Błąd"
Expand Down
41 changes: 33 additions & 8 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,24 @@ def logout():
sky.delete_cookie()

def login():
def ask_credentials(username=''):
def ask_credentials(username='', password=''):
username = input_window(addon.getLocalizedString(30163), username) # Username
if username:
password = input_window(addon.getLocalizedString(30164), hidden=True) # Password
password = input_window(addon.getLocalizedString(30164), password, hidden=True) # Password
if password:
return username, password
return None, None

username, password = ask_credentials()
store_credentials = addon.getSettingBool('store_credentials')
if store_credentials:
username, password = sky.load_credentials()
else:
username, password = ('', '')

username, password = ask_credentials(username, password)
if username:
if store_credentials:
sky.save_credentials(username, password)
success, _ = sky.login(username, password)
if success:
clear_session()
Expand All @@ -392,15 +400,26 @@ def export_key():
sky.export_key_file(directory)

def list_users():
open_folder(addon.getLocalizedString(30160)) # Change user
add_menu_option(addon.getLocalizedString(30183), get_url(action='login', method='credentials')) # Login with username
add_menu_option(addon.getLocalizedString(30181), get_url(action='login', method='key')) # Login with key
add_menu_option(addon.getLocalizedString(30186), get_url(action='login', method='cookie')) # Login with cookie
platform_name = addon.getSetting('platform_id')
open_folder(addon.getLocalizedString(30160)) # Accounts
add_menu_option(addon.getLocalizedString(30191).format(platform_name), get_url(action='login', method='credentials')) # Login with username
add_menu_option(addon.getLocalizedString(30190).format(platform_name), get_url(action='login', method='key')) # Login with key
#add_menu_option(addon.getLocalizedString(30186), get_url(action='login', method='cookie')) # Login with cookie
if sky.account['cookie']:
add_menu_option(addon.getLocalizedString(30184), get_url(action='export_key')) # Export key
add_menu_option(addon.getLocalizedString(30150), get_url(action='logout')) # Close session
close_folder()

def list_platforms():
platforms = ['SkyShowtime', 'PeacockTV']
open_folder(addon.getLocalizedString(30160)) # Accounts
for platform in platforms:
name = addon.getLocalizedString(30192).format(platform)
if platform == addon.getSetting('platform_id'):
name = '[B][COLOR blue]' + name + '[/COLOR][/B]'
add_menu_option(name, get_url(action='select_platform', platform=platform))
close_folder()

def to_watchlist(params):
retcode, message = sky.to_watchlist(slug=params['slug'], action=params['op'])
if retcode == 201:
Expand Down Expand Up @@ -471,6 +490,11 @@ def router(paramstring):
list_users()
elif params['action'] == 'logout':
logout()
elif params['action'] == 'platforms':
list_platforms()
elif params['action'] == 'select_platform':
addon.setSetting('platform_id', params['platform'])
list_users()
elif params['action'] == 'wishlist':
add_videos(addon.getLocalizedString(30102), 'movies', sky.get_my_list(), from_watchlist=True)
elif params['action'] == 'continue-watching':
Expand Down Expand Up @@ -518,7 +542,8 @@ def router(paramstring):
add_menu_option(addon.getLocalizedString(30180), get_url(action='profiles')) # Profiles
#add_menu_option(addon.getLocalizedString(30108), get_url(action='devices')) # Devices

add_menu_option(addon.getLocalizedString(30160), get_url(action='user')) # Accounts
#add_menu_option(addon.getLocalizedString(30160), get_url(action='user')) # Accounts
add_menu_option(addon.getLocalizedString(30160), get_url(action='platforms')) # Accounts
close_folder(cacheToDisc=False)


Expand Down
19 changes: 18 additions & 1 deletion resources/lib/sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SkyShowtime(object):
account = {'username': None, 'password': None,
'device_id': None,
'profile_id': None, 'profile_type': None,
'my_segments': [],
'my_segments': [], 'account_type': [],
'cookie': None, 'user_token': None}
get_token_error = ''

Expand Down Expand Up @@ -188,6 +188,8 @@ def __init__(self, config_directory, platform='skyshowtime', territory=None):
self.cache.save_json(me_filename, data)
for s in data.get('segmentation', []).get('content', []):
self.account['my_segments'].append(s['name'])
for s in data.get('segmentation', []).get('account', []):
self.account['account_type'].append(s['name'])

def is_subscribed(self, segments):
for s in self.account['my_segments']:
Expand Down Expand Up @@ -1005,3 +1007,18 @@ def clear_session(self):
files = ['device_id.conf', 'localisation.json', 'profile.json', 'profile_info.json', 'token.json', 'menu.json', 'me.json']
for f in files:
self.cache.remove_file(self.pldir +'/'+ f)

def save_credentials(self, username, password):
from .b64 import encode_base64
data = {'username': username, 'password': encode_base64(password)}
self.cache.save_json(self.pldir + '/credentials.json', data)

def load_credentials(self):
from .b64 import decode_base64
content = self.cache.load_file(self.pldir + '/credentials.json')
if content:
data = json.loads(content)
return data['username'], decode_base64(data['password'])
else:
return '', ''

Binary file modified resources/screen1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/screen2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/screen3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<settings>
<category label="30001">
<setting id="platform_id" type="labelenum" label="30031" values="SkyShowtime|PeacockTV" default="PeacockTV"/>
<setting id="platform_id" type="labelenum" label="30031" values="SkyShowtime|PeacockTV" default="SkyShowtime" visible="false"/>
<setting id="store_credentials" type="bool" label="30050" default="false"/>
<setting id="territory" type="text" label="30041" default=""/>
<setting id="preferred_server" type="labelenum" label="30032" values="Auto|Limelight|Cloudfront|Akamai|Level3|Fastly" default='Auto'/>
<setting id="uhd" type="bool" label="30033" default="false"/>
Expand Down

0 comments on commit 4a5a55c

Please sign in to comment.