Version 0.7.13
This commit is contained in:
1 parent
95f540c0fe
commit
428388825c
24 files changed
+287
-24
No files matched your search
@@ -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()
|
||||
@@ -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:
|
||||
|
||||
@@ -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('<?xml version="1.0" encoding="UTF-8"?>\n' +
|
||||
@@ -1169,12 +1176,12 @@ class Movistar(object):
|
||||
res.append('<programme start="{}" stop="{}" channel="{}"'.format(start, stop, ch['id']) +
|
||||
(' catchup-id="{}"'.format(url) if url else "") +
|
||||
'>\n' +
|
||||
' <title>{}</title>\n'.format(e['title']) +
|
||||
' <sub-title>{}</sub-title>\n'.format(e['subtitle']))
|
||||
' <title>{}</title>\n'.format(html_escape(e['title'])) +
|
||||
' <sub-title>{}</sub-title>\n'.format(html_escape(e['subtitle'])))
|
||||
if 'image' in e:
|
||||
res.append(' <icon src="{}"/>\n'.format(e['image']))
|
||||
if 'description' in e:
|
||||
res.append(' <desc>{}</desc>\n'.format(e['description']))
|
||||
res.append(' <desc>{}</desc>\n'.format(html_escape(e['description'])))
|
||||
if 'credits' in e and len(e['credits']) > 0:
|
||||
res.append(' <credits>\n');
|
||||
for c in e['credits']:
|
||||
|
||||
+18
-13
@@ -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)
|
||||
Reference in new issue
Block a user