diff --git a/addon.xml b/addon.xml index 27e7ef1..9eac926 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/icons/account.png b/resources/icons/account.png new file mode 100644 index 0000000..15ce11e Binary files /dev/null and b/resources/icons/account.png differ diff --git a/resources/icons/devices.png b/resources/icons/devices.png new file mode 100644 index 0000000..e49bdef Binary files /dev/null and b/resources/icons/devices.png differ diff --git a/resources/icons/epg.png b/resources/icons/epg.png new file mode 100644 index 0000000..a48b5dc Binary files /dev/null and b/resources/icons/epg.png differ diff --git a/resources/icons/mylist.png b/resources/icons/mylist.png new file mode 100644 index 0000000..386a236 Binary files /dev/null and b/resources/icons/mylist.png differ diff --git a/resources/icons/profiles.png b/resources/icons/profiles.png new file mode 100644 index 0000000..2468aa9 Binary files /dev/null and b/resources/icons/profiles.png differ diff --git a/resources/icons/recording.png b/resources/icons/recording.png new file mode 100644 index 0000000..e36b72d Binary files /dev/null and b/resources/icons/recording.png differ diff --git a/resources/icons/search.png b/resources/icons/search.png new file mode 100644 index 0000000..0e06f8b Binary files /dev/null and b/resources/icons/search.png differ diff --git a/resources/icons/tv.png b/resources/icons/tv.png new file mode 100644 index 0000000..00c959f Binary files /dev/null and b/resources/icons/tv.png differ diff --git a/resources/icons/vod.png b/resources/icons/vod.png new file mode 100644 index 0000000..8fc1b75 Binary files /dev/null and b/resources/icons/vod.png differ diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 7be6073..bb92021 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -29,6 +29,10 @@ msgctxt "#30003" msgid "Experimental" msgstr "" +msgctxt "#30004" +msgid "Subtitles" +msgstr "" + # For Orange and Movistar only msgctxt "#30010" msgid "DRM type" @@ -95,6 +99,10 @@ msgctxt "#30025" msgid "Send video progress to provider's server" msgstr "" +msgctxt "#30026" +msgid "Update interval (in seconds)" +msgstr "" + # For SkyOTT only msgctxt "#30031" msgid "Streaming service" @@ -132,7 +140,7 @@ msgstr "" # For SkyOTT only msgctxt "#30040" -msgid "Use only for these languages (e.g.: es en pt):" +msgid "Use for these languages (e.g.: es en pt):" msgstr "" # For SkyOTT only @@ -140,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 "" @@ -274,6 +287,15 @@ msgctxt "#30167" msgid "Edit account" msgstr "" +msgctxt "#30168" +msgid "Login successful" +msgstr "" + +# For Orange and Movistar only +msgctxt "#30169" +msgid "Record season" +msgstr "" + # For Orange and Movistar only msgctxt "#30170" msgid "Play from the beginning" @@ -315,6 +337,10 @@ msgctxt "#30178" msgid "Title removed from my list" msgstr "" +msgctxt "#30179" +msgid "Remove from continue watching" +msgstr "" + msgctxt "#30180" msgid "Profiles" msgstr "" @@ -347,6 +373,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 "" @@ -448,3 +486,19 @@ msgstr "" msgctxt "#30321" msgid "Show age rating before playback" msgstr "" + +msgctxt "#30400" +msgid "{} days remaining" +msgstr "" + +msgctxt "#30401" +msgid "{} hours remaining" +msgstr "" + +msgctxt "#30450" +msgid "Buy the developer a coffee" +msgstr "" + +msgctxt "#30451" +msgid "If you find this addon useful you can buy the developer a coffee:" +msgstr "" diff --git a/resources/language/resource.language.es_es/strings.po b/resources/language/resource.language.es_es/strings.po index af4237e..9148077 100644 --- a/resources/language/resource.language.es_es/strings.po +++ b/resources/language/resource.language.es_es/strings.po @@ -12,7 +12,7 @@ msgstr "" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE\n" -"Language: en\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -29,6 +29,10 @@ msgctxt "#30003" msgid "Experimental" msgstr "Experimental" +msgctxt "#30004" +msgid "Subtitles" +msgstr "Subtítulos" + msgctxt "#30010" msgid "DRM type" msgstr "Tipo de DRM" @@ -85,6 +89,10 @@ msgctxt "#30025" msgid "Send video progress to provider's server" msgstr "Enviar progreso al servidor de la plataforma" +msgctxt "#30026" +msgid "Update interval (in seconds)" +msgstr "Tiempo entre actualizaciones (en segundos)" + msgctxt "#30031" msgid "Streaming service" msgstr "Plataforma" @@ -114,15 +122,21 @@ msgctxt "#30037" msgid "Enable HDCP" msgstr "Habilitar HDCP" +# For SkyOTT only msgctxt "#30040" -msgid "Use only for these languages (e.g.: es en pt):" -msgstr "Usar solo para estos idiomas (ej: es en pt):" +msgid "Use for these languages (e.g.: es en pt):" +msgstr "Usar para estos idiomas (ej: es en pt):" # For SkyOTT only 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ú" @@ -255,6 +269,15 @@ msgctxt "#30167" msgid "Edit account" msgstr "Editar cuenta" +msgctxt "#30168" +msgid "Login successful" +msgstr "Se ha iniciado sesión" + +# For Orange and Movistar only +msgctxt "#30169" +msgid "Record season" +msgstr "Grabar temporada" + msgctxt "#30170" msgid "Play from the beginning" msgstr "Ver desde el principio" @@ -291,6 +314,10 @@ msgctxt "#30178" msgid "Title removed from my list" msgstr "Título quitado de mi lista" +msgctxt "#30179" +msgid "Remove from continue watching" +msgstr "Quitar de seguir viendo" + msgctxt "#30180" msgid "Profiles" msgstr "Perfiles" @@ -323,6 +350,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" @@ -372,6 +411,11 @@ msgctxt "#30303" msgid "IPTV Manager settings" msgstr "Opciones de IPTV Manager" +# For Orange and Movistar only +msgctxt "#30304" +msgid "IPTV" +msgstr "IPTV" + msgctxt "#30305" msgid "Export channels and EPG for IPTV automatically" msgstr "Exportar automáticamente canales y guía para IPTV" @@ -407,3 +451,23 @@ msgstr "Calificación: {}" msgctxt "#30321" msgid "Show age rating before playback" msgstr "Mostrar la calificación de edades al empezar la reproducción" + +msgctxt "#30400" +msgid "{} days remaining" +msgstr "quedan {} días" + +msgctxt "#30401" +msgid "{} hours remaining" +msgstr "quedan {} horas" + +msgctxt "#30450" +msgid "Buy the developer a coffee" +msgstr "Invita al programador a un café" + +msgctxt "#30451" +msgid "If you find this addon useful you can buy the developer a coffee:" +msgstr "Si este addon es útil para ti puedes invitar al programador a un café:" + +#~ msgctxt "#30040" +#~ msgid "Use only for these languages (e.g.: es en pt):" +#~ msgstr "Usar solo para estos idiomas (ej: es en pt):" diff --git a/resources/lib/customdialog.py b/resources/lib/customdialog.py new file mode 100644 index 0000000..5e53c16 --- /dev/null +++ b/resources/lib/customdialog.py @@ -0,0 +1,44 @@ +# encoding: utf-8 +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +from __future__ import unicode_literals, absolute_import, division + +import xbmcgui +import xbmc +import xbmcaddon + +class CustomDialog(xbmcgui.WindowXMLDialog): + def __init__(self, *args, **kwargs): + self.image = kwargs.get("image", "") + #self.heading = kwargs.get("heading", "") + self.text = kwargs.get("text", "") + + def onInit(self): + self.imagecontrol = 501 + self.textbox = 502 + self.okbutton = 503 + self.heading = 504 + self.showdialog() + + def showdialog(self): + self.getControl(self.imagecontrol).setImage(self.image) + self.getControl(self.textbox).setText(self.text) + #self.getControl(self.heading).setLabel(self.heading) + self.setFocus(self.getControl(self.okbutton)) + + def onClick(self, controlId): + if (controlId == self.okbutton): + self.close() + +def show_donation_dialog(): + addon = xbmcaddon.Addon() + try: + CWD = addon.getAddonInfo('path').decode('utf-8') + except: + CWD = addon.getAddonInfo('path') + image = 'qr.png' + text = addon.getLocalizedString(30451) + text += '[CR]https://www.buymeacoffee.com/addons' + dialog = CustomDialog("customdialog.xml", CWD, 'default', '1080i', text=text, image=image) + dialog.doModal() diff --git a/resources/lib/gui.py b/resources/lib/gui.py index 3532a6e..10fad79 100644 --- a/resources/lib/gui.py +++ b/resources/lib/gui.py @@ -7,7 +7,7 @@ import xbmc import xbmcgui import xbmcplugin from .log import LOG -from .addon import addon +from .addon import addon,translatePath def handle(): try: @@ -34,12 +34,16 @@ def open_folder(name, content_type = 'videos'): def close_folder(updateListing=False, cacheToDisc=True): xbmcplugin.endOfDirectory(handle(), updateListing=updateListing, cacheToDisc=cacheToDisc) -def add_menu_option(title, url, context_menu = None, info = None, art = None): +def add_menu_option(title, url, context_menu = None, info = None, art = None, icon=None): list_item = xbmcgui.ListItem(label=title) if not info: info = {'title': title, 'plot': '[B][/B]'} if not art: art = {'icon': addon.getAddonInfo('icon'), 'poster': addon.getAddonInfo('icon')} + if icon: + path = addon.getAddonInfo('path') + icon_path = translatePath(path + '/resources/icons/' + icon) + art = {'icon': icon_path, 'poster': icon_path} list_item.setInfo('video', info) list_item.setArt(art) if context_menu: diff --git a/resources/lib/movistar.py b/resources/lib/movistar.py index 739188d..f8e5297 100644 --- a/resources/lib/movistar.py +++ b/resources/lib/movistar.py @@ -1145,6 +1145,13 @@ class Movistar(object): return res def export_epg_to_xml(self, filename): + if sys.version_info[0] < 3: + # Python 2 + from cgi import escape as html_escape + else: + # Python 3 + from html import escape as html_escape + channels = self.export_channels() res = [] res.append('\n' + @@ -1169,12 +1176,12 @@ class Movistar(object): res.append('\n' + - ' {}\n'.format(e['title']) + - ' {}\n'.format(e['subtitle'])) + ' {}\n'.format(html_escape(e['title'])) + + ' {}\n'.format(html_escape(e['subtitle']))) if 'image' in e: res.append(' \n'.format(e['image'])) if 'description' in e: - res.append(' {}\n'.format(e['description'])) + res.append(' {}\n'.format(html_escape(e['description']))) if 'credits' in e and len(e['credits']) > 0: res.append(' \n'); for c in e['credits']: diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index 4a23fef..b896188 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -641,23 +641,31 @@ def router(paramstring): else: # Main open_folder(addon.getLocalizedString(30101)) # Menu - xbmcplugin.setContent(_handle, 'files') if m.logged: - add_menu_option(addon.getLocalizedString(30104), get_url(action='tv')) # TV - add_menu_option(addon.getLocalizedString(30107), get_url(action='epg')) # EGP - add_menu_option(addon.getLocalizedString(30102), get_url(action='wishlist')) # My list - add_menu_option(addon.getLocalizedString(30103), get_url(action='recordings')) # Recordings - add_menu_option(addon.getLocalizedString(30111), get_url(action='vod')) # VOD - add_menu_option(addon.getLocalizedString(30112), get_url(action='search')) # Search - 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(30104), get_url(action='tv'), icon='tv.png') # TV + add_menu_option(addon.getLocalizedString(30107), get_url(action='epg'), icon='epg.png') # EGP + add_menu_option(addon.getLocalizedString(30102), get_url(action='wishlist'), icon='mylist.png') # My list + add_menu_option(addon.getLocalizedString(30103), get_url(action='recordings'), icon='recording.png') # Recordings + add_menu_option(addon.getLocalizedString(30111), get_url(action='vod'), icon='vod.png') # VOD + add_menu_option(addon.getLocalizedString(30112), get_url(action='search'), icon='search.png') # Search + add_menu_option(addon.getLocalizedString(30180), get_url(action='profiles'), icon='profiles.png') # Profiles + add_menu_option(addon.getLocalizedString(30108), get_url(action='devices'), icon='devices.png') # Devices - add_menu_option(addon.getLocalizedString(30160), get_url(action='user')) # Accounts + add_menu_option(addon.getLocalizedString(30160), get_url(action='user'), icon='account.png') # Accounts close_folder(cacheToDisc=False) def run(): + # Call the router function and pass the plugin call parameters to it. + # We use string slicing to trim the leading '?' from the plugin call paramstring + params = sys.argv[2][1:] + + if 'show_donation_dialog' in params: + from .customdialog import show_donation_dialog + show_donation_dialog() + return + global m reuse_devices = addon.getSettingBool('reuse_devices') LOG('profile_dir: {}'.format(profile_dir)) @@ -673,9 +681,6 @@ def run(): # Clear cache LOG('Cleaning cache. {} files removed.'.format(m.cache.clear_cache())) - # Call the router function and pass the plugin call parameters to it. - # We use string slicing to trim the leading '?' from the plugin call paramstring - params = sys.argv[2][1:] if '/iptv/channels' in sys.argv[0]: params += '&action=iptv-channels' elif '/iptv/epg' in sys.argv[0]: params += '&action=iptv-epg' router(params) diff --git a/resources/settings.xml b/resources/settings.xml index 996ff65..ce7f7c3 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -8,8 +8,9 @@ - + + diff --git a/resources/skins/default/1080i/customdialog.xml b/resources/skins/default/1080i/customdialog.xml new file mode 100644 index 0000000..2fdd7a3 --- /dev/null +++ b/resources/skins/default/1080i/customdialog.xml @@ -0,0 +1,84 @@ + + + + 502 + 345 + + + + + + + + + + + + -1920 + -1080 + 5760 + 3240 + WindowOpen + WindowClose + black.png + + + 0 + 0 + 1030 + 380 + dialog-bg.png + + + 0 + 0 + 1030 + 70 + white.png + + + 70 + 0 + 0 + 1030 + 70 + font20_title + + center + center + FF000000 + + + 30 + 75 + 300 + 300 + keep + + + 360 + 85 + 660 + 300 + font12_title + left + top + FF000000 + + + 715 + 290 + 300 + 90 + font12_title + FFF0F0F0 + 20 + + center + center + dialogbutton-fo.png + dialogbutton-nofo.png + + + + diff --git a/resources/skins/default/media/black.png b/resources/skins/default/media/black.png new file mode 100644 index 0000000..2ff1770 Binary files /dev/null and b/resources/skins/default/media/black.png differ diff --git a/resources/skins/default/media/dialog-bg.png b/resources/skins/default/media/dialog-bg.png new file mode 100644 index 0000000..e8c13eb Binary files /dev/null and b/resources/skins/default/media/dialog-bg.png differ diff --git a/resources/skins/default/media/dialogbutton-fo.png b/resources/skins/default/media/dialogbutton-fo.png new file mode 100644 index 0000000..a161d6e Binary files /dev/null and b/resources/skins/default/media/dialogbutton-fo.png differ diff --git a/resources/skins/default/media/dialogbutton-nofo.png b/resources/skins/default/media/dialogbutton-nofo.png new file mode 100644 index 0000000..5d24279 Binary files /dev/null and b/resources/skins/default/media/dialogbutton-nofo.png differ diff --git a/resources/skins/default/media/qr.png b/resources/skins/default/media/qr.png new file mode 100644 index 0000000..c4eaa91 Binary files /dev/null and b/resources/skins/default/media/qr.png differ diff --git a/resources/skins/default/media/white.png b/resources/skins/default/media/white.png new file mode 100644 index 0000000..528c66f Binary files /dev/null and b/resources/skins/default/media/white.png differ