diff --git a/CONTROL/control b/CONTROL/control index 46ab233..e783dee 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,6 +1,6 @@ Description: TVMagazineCockpit Maintainer: dream-alpha Package: enigma2-plugin-extensions-tvmagazinecockpit -Version: 0.6.0 +Version: 0.7.0 Architecture: all Depends: enigma2-plugin-skincomponents-extmultilistselection diff --git a/docs/index.html b/docs/index.html index 8a9046e..531f723 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,8 +1,15 @@

TVMagazineCockpit Installation

- To install TVMagazineCockpit execute the following command in a telnet console on your dreambox: -

- wget https://dream-alpha.github.io/TVMagazineCockpit/tvmagazinecockpit.sh -O - | /bin/sh + To install the TVMagazineCockpit plugin execute the following commands in a telnet console on your dreambox: +

+ The installation script will also install a feed source that enables a convenient upgrade to the latest version with the following commands or automatically as part of a DreamOS upgrade: + diff --git a/po/TVMagazineCockpit.pot b/po/TVMagazineCockpit.pot index 6dc0da1..f70acfb 100644 --- a/po/TVMagazineCockpit.pot +++ b/po/TVMagazineCockpit.pot @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-05-24 19:04+0200\n" -"PO-Revision-Date: 2024-05-24 19:04+0200\n" +"POT-Creation-Date: 2024-05-28 17:36+0200\n" +"PO-Revision-Date: 2024-05-28 17:36+0200\n" "Last-Translator: dream-alpha\n" "Language-Team: \n" "Language: de_DE\n" @@ -14,148 +14,145 @@ msgstr "" "X-Poedit-Basepath: ../src\n" "X-Poedit-SearchPath-0: .\n" -msgid "Tv Spielfilm Main" -msgstr "" - -msgid "Tv Spielfilm Tips" +msgid "Bouquets (TV)" msgstr "" -msgid "Tv Spielfilm Programm Standard" +msgid "Available channel selection" msgstr "" -msgid "Tv Spielfilm Programm Favourites" +msgid "All available channels" msgstr "" -msgid "Tv Spielfilm Programm Sky" +msgid "Favourites" msgstr "" -msgid "Tv Spielfilm Search" +msgid "Service reference" msgstr "" -msgid "Error during download" +msgid "not found" msgstr "" -msgid "Setup" +msgid "Not installed" msgstr "" -msgid "Favourites" +msgid "installed" msgstr "" -msgid "Bouquets" +msgid "Entries" msgstr "" -msgid "Easy-Selection" +msgid "Button" msgstr "" -msgid "Input" +msgid "for" msgstr "" -msgid "Search" +msgid "install" msgstr "" -msgid "Reload" +msgid "Channel Selection" msgstr "" -msgid "Loading..." +msgid "Press OK to edit the settings." msgstr "" -msgid "Page" +msgid "menu" msgstr "" -msgid "Services" +msgid "Remove entry" msgstr "" -msgid "There was an error downloading the packetlist. Please try again." +msgid "enable move mode" msgstr "" -msgid "Bouquets (TV)" +msgid "Add to favourites" msgstr "" -msgid "Available channel selection" +msgid "name difference" msgstr "" -msgid "All available channels" +msgid "Select" msgstr "" -msgid "Service reference" +msgid "Delete" msgstr "" -msgid "Not installed" +msgid "Zap" msgstr "" -msgid "installed" +msgid "remove entry" msgstr "" -msgid "Entries" +msgid "all" msgstr "" -msgid "Button" +msgid "Edit" msgstr "" -msgid "for" +msgid "Serviceinfo" msgstr "" -msgid "install" +msgid "[move mode]" msgstr "" -msgid "Channel Selection" +msgid "enabled" msgstr "" -msgid "Press OK to edit the settings." +msgid "Write enigma2 all service in tmp" msgstr "" -msgid "menu" +msgid "Write debug messages into file" msgstr "" -msgid "Remove entry" +msgid "Tv Spielfilm Main" msgstr "" -msgid "enable move mode" +msgid "Tv Spielfilm Tips" msgstr "" -msgid "Add to favourites" +msgid "Tv Spielfilm Programm Standard" msgstr "" -msgid "name difference" +msgid "Tv Spielfilm Programm Favourites" msgstr "" -msgid "Select" +msgid "Tv Spielfilm Programm Sky" msgstr "" -msgid "Delete" +msgid "Tv Spielfilm Search" msgstr "" -msgid "Zap" +msgid "Error during download" msgstr "" -msgid "remove entry" +msgid "Setup" msgstr "" -msgid "all" +msgid "Bouquets" msgstr "" -msgid "Edit" +msgid "Easy-Selection" msgstr "" -msgid "not found" +msgid "Input" msgstr "" -msgid "Serviceinfo" +msgid "Search" msgstr "" -msgid "[move mode]" +msgid "Reload" msgstr "" -msgid "enabled" +msgid "Loading..." msgstr "" -msgid "Installation finished." +msgid "Page" msgstr "" -msgid "Write enigma2 all service in tmp" +msgid "Services" msgstr "" -msgid "Write debug messages into file" +msgid "There was an error downloading the packetlist. Please try again." msgstr "" msgid "Abort" @@ -358,12 +355,3 @@ msgstr "" msgid "No entries found" msgstr "" - -msgid "None" -msgstr "" - -msgid "found" -msgstr "" - -msgid "Nothing there!" -msgstr "" diff --git a/po/de.po b/po/de.po index ac7d41c..ad922b0 100644 --- a/po/de.po +++ b/po/de.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2024-05-24 19:04+0200\n" -"PO-Revision-Date: 2024-05-24 19:04+0200\n" +"POT-Creation-Date: 2024-05-28 17:36+0200\n" +"PO-Revision-Date: 2024-05-28 17:36+0200\n" "Last-Translator: dream-alpha\n" "Language-Team: \n" "Language: de_DE\n" @@ -14,60 +14,6 @@ msgstr "" "X-Poedit-Basepath: ../src\n" "X-Poedit-SearchPath-0: .\n" -msgid "Tv Spielfilm Main" -msgstr "Tv Spielfilm Hauptseite" - -msgid "Tv Spielfilm Tips" -msgstr "Tv Spielfilm Tipps" - -msgid "Tv Spielfilm Programm Standard" -msgstr "Tv Spielfilm Programm Standard" - -msgid "Tv Spielfilm Programm Favourites" -msgstr "Tv Spielfilm Programm Favoriten" - -msgid "Tv Spielfilm Programm Sky" -msgstr "Tv Spielfilm Programm Sky" - -msgid "Tv Spielfilm Search" -msgstr "Tv Spielfilm Suche" - -msgid "Error during download" -msgstr "Fehler beim Download" - -msgid "Setup" -msgstr "Einstellungen" - -msgid "Favourites" -msgstr "Favoriten" - -msgid "Bouquets" -msgstr "Bouquets" - -msgid "Easy-Selection" -msgstr "Einfach-Auswahl" - -msgid "Input" -msgstr "Eingabe" - -msgid "Search" -msgstr "Suche" - -msgid "Reload" -msgstr "Neu laden" - -msgid "Loading..." -msgstr "Lade..." - -msgid "Page" -msgstr "Seite" - -msgid "Services" -msgstr "Kanäle" - -msgid "There was an error downloading the packetlist. Please try again." -msgstr "Fehler beim Downloaden der Paketliste." - msgid "Bouquets (TV)" msgstr "Bouquets (TV)" @@ -77,8 +23,14 @@ msgstr "Auswahl der verfügbaren Kanäle" msgid "All available channels" msgstr "Alle verfügbaren Kanäle" +msgid "Favourites" +msgstr "Favoriten" + msgid "Service reference" -msgstr "Service Referenz" +msgstr "Kanal Referenz" + +msgid "not found" +msgstr "nicht gefunden" msgid "Not installed" msgstr "Nicht installiert" @@ -137,11 +89,8 @@ msgstr "alle" msgid "Edit" msgstr "Editieren" -msgid "not found" -msgstr "nicht gefunden" - msgid "Serviceinfo" -msgstr "Kanalinformation" +msgstr "Kanal Information" msgid "[move mode]" msgstr "[Verschiebemodus]" @@ -149,15 +98,63 @@ msgstr "[Verschiebemodus]" msgid "enabled" msgstr "aktiviert" -msgid "Installation finished." -msgstr "Installation beendet" - msgid "Write enigma2 all service in tmp" msgstr "Speichere alle Kanäle nach /tmp" msgid "Write debug messages into file" msgstr "Speichere Debug Messages in eine Datei" +msgid "Tv Spielfilm Main" +msgstr "Tv Spielfilm Hauptseite" + +msgid "Tv Spielfilm Tips" +msgstr "Tv Spielfilm Tipps" + +msgid "Tv Spielfilm Programm Standard" +msgstr "Tv Spielfilm Programm Standard" + +msgid "Tv Spielfilm Programm Favourites" +msgstr "Tv Spielfilm Programm Favoriten" + +msgid "Tv Spielfilm Programm Sky" +msgstr "Tv Spielfilm Programm Sky" + +msgid "Tv Spielfilm Search" +msgstr "Tv Spielfilm Suche" + +msgid "Error during download" +msgstr "Fehler beim Download" + +msgid "Setup" +msgstr "Einstellungen" + +msgid "Bouquets" +msgstr "Bouquets" + +msgid "Easy-Selection" +msgstr "Einfach-Auswahl" + +msgid "Input" +msgstr "Eingabe" + +msgid "Search" +msgstr "Suche" + +msgid "Reload" +msgstr "Neu laden" + +msgid "Loading..." +msgstr "Lade..." + +msgid "Page" +msgstr "Seite" + +msgid "Services" +msgstr "Kanäle" + +msgid "There was an error downloading the packetlist. Please try again." +msgstr "Fehler beim Downloaden der Paketliste." + msgid "Abort" msgstr "Abbrechen" @@ -168,7 +165,7 @@ msgid "Page:" msgstr "Seite:" msgid "Nothing found..." -msgstr "Kein Fund" +msgstr "Nichts gefunden..." msgid "Only" msgstr "Nur" @@ -309,7 +306,7 @@ msgid "Series" msgstr "Serie" msgid "Report" -msgstr "Report" +msgstr "Reportage" msgid "Entertainment" msgstr "Unterhaltung" @@ -358,12 +355,3 @@ msgstr "Entfernen" msgid "No entries found" msgstr "Keine Einträge gefunden" - -msgid "None" -msgstr "Nichts" - -msgid "found" -msgstr "gefunden" - -msgid "Nothing there!" -msgstr "Nichts vorhanden" diff --git a/src/ChannelGroupSelection.py b/src/ChannelGroupSelection.py index ce317aa..e235f31 100644 --- a/src/ChannelGroupSelection.py +++ b/src/ChannelGroupSelection.py @@ -17,7 +17,7 @@ def __init__(self, session, channel_list, page_index_parm=0): ["TVS_Actions"], { "ok": self.key_ok, - "cancel": self.close + "cancel": self.key_cancel } ) self["liste"] = MYList() @@ -55,6 +55,10 @@ def key_ok(self): if curr: self.close(curr[0]) + def key_cancel(self): + logger.info("...") + self.close(self.page_index) + def createSummary(self): logger.info("...") return MYSimpleSummary diff --git a/src/TvSpielfilmchannel.py b/src/ChannelManagement.py similarity index 69% rename from src/TvSpielfilmchannel.py rename to src/ChannelManagement.py index 0df824a..4d2a7f3 100644 --- a/src/TvSpielfilmchannel.py +++ b/src/ChannelManagement.py @@ -16,21 +16,22 @@ from Tools.Directories import pathExists from ServiceReference import ServiceReference from .tvconfig import write_channels, channels_file_name, _premode, write_error_log -from .tvconfig import read_channel_list, is_in_fovo, write_default_channels, configdefaultchannelsuser, read_channel_list_favo -from .tvconfig import read_default_channels, read_file_tvdefault, checkvideomode, prevideodict +from .tvconfig import is_in_fovo, write_default_channels, configdefaultchannelsuser +from .tvconfig import checkvideomode, prevideodict from ._tvdict import _tv_config, _channelcache, _tv_config_config, _changed from .tvspielfilmsetup import TvSpielfilmservice from .__init__ import _ from .MYList import MYList from .ZapUtils import Zap_Service from .Debug import logger +from .ChannelUtils import read_channel_list, read_channel_dict -class TvSpielfilmchannel(Screen): +class ChannelManagement(Screen): def __init__(self, session): logger.info("...") - self.skinName = "TvSpielfilmchannel" Screen.__init__(self, session) + self.skinName = "TvSpielfilmchannel" self["actions"] = ActionMap( ["TVS_Actions"], { @@ -61,7 +62,7 @@ def __init__(self, session): self["key_yellow"] = StaticText(_('All available channels')) self["key_blue"] = StaticText(_('Favourites')) - self["liste"] = MYList([]) + self["liste"] = MYList() self["liste"].style = "default" self.mytitlestr = ('mytitle1', 'mytitle2', 'mytitle3', 'mytitle4', 'mytitle5') self["mytitle1"] = Label('Tv Spielfilm Name') @@ -74,10 +75,22 @@ def __init__(self, session): self["message"] = Label() self.listtype = '' self.masterliste = {} - self.masterliste['favourites'] = read_channel_list_favo() + self.masterliste['favourites'] = self.createList(read_channel_dict(read_channel_list("favorites"))) self.masterliste['defaultchannels'] = [] self.masterliste['notfound'] = {} + def createList(self, channel_dict): + result = [] + for key, value in channel_dict.iteritems(): + enameval = '' + ename = ServiceReference(str(value['service'])).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') + if not ename: + enameval = _('not found') + elif value['ename'] != ename: + enameval = ename + result.append([value['tname'], key, value['ename'], value['service'], enameval]) + return result + def donot(self): logger.info("...") @@ -144,15 +157,20 @@ def key_red(self): text += " %s %s %s %s" % ('OK', _('Button'), _('for'), _('install')) self["message"].setText(text) - def key_green(self): +# self.masterliste[bouquet][service] = {} +# self.masterliste[bouquet][service]['ename'] = ename +# self.masterliste[bouquet][service]['position'] = resultlen +# self.masterliste[bouquet][ename] = {'ename': ename, 'service': service, 'position': resultlen} + + def key_green(self, bouquet=""): logger.info("...") self.setTitle(self["key_green"].text) self.listtype = 'green' self["actionsmove"].setEnabled(False) mylist = [] - for cval in _tv_config.get('channel_bouquet'): - val = _tv_config['channel_bouquet'][cval] - mylist.append([str(val.get('disname')), '', cval]) + for service, value in self.masterliste[bouquet].iteritems(): + logger.debug("service: %s, value: %s", service, value) + mylist.append([value["ename"], service, '']) mylist.sort() for myx in self.mytitlestr: self[myx].hide() @@ -172,7 +190,7 @@ def key_yellow(self): self["mytitle5"].text = _('Favourites') self["liste"].style = "channel_bouquet" if not self.masterliste['defaultchannels']: - self.masterliste['defaultchannels'] = read_default_channels(True) + self.masterliste['defaultchannels'] = read_channel_dict() self["liste"].updateList(self.masterliste['defaultchannels']) # curr = self["liste"].getCurrent() text = "[%s] %d %s" % (self["key_yellow"].text, self["liste"].count(), _('Entries')) @@ -188,6 +206,7 @@ def key_blue(self): self[myx].show() self["mytitle5"].text = _('name difference') self["liste"].style = "channel_bouquet" + logger.debug("self.masterliste['favourites']: %s", self.masterliste['favourites']) self["liste"].updateList(self.masterliste['favourites']) text = "[%s] %d %s" % (_('Favourites'), self["liste"].count(), _('Entries')) text += " OK %s %s / %s %s %s" % (_("Button"), _('enable move mode'), _("menu"), _("Button"), _("Remove entry")) @@ -353,9 +372,9 @@ def key_ok(self): if curr and len(curr) >= 4: if pathExists(curr[4]) and _tv_config['channel_bouquet'].get(curr[3]): text = "%s %s\n\n%s" % (curr[0], 'ist schon vorhanden', 'Überschreiben') - self.session.openWithCallback(self.istall_bouquet, MessageBox, text) + self.session.openWithCallback(self.install_bouquet, MessageBox, text) else: - self.istall_bouquet() + self.install_bouquet() elif self.listtype == 'green': if curr and len(curr) >= 2: filename = channels_file_name(curr[2]) @@ -365,7 +384,7 @@ def key_ok(self): self["mytitle5"].text = _('Favourites') self.listtype = 'addfavo' self["liste"].style = "channel_bouquet" - result = read_channel_list(filename) + result = read_channel_dict() if len(result) > 0: if 'Alle_Sender__Enigma' in filename: if _channelcache['favo'].has_key('leng'): @@ -392,155 +411,28 @@ def key_ok(self): self["actionsmove"].setEnabled(False) self.setTitle(self["key_yellow"].text) - def istall_bouquet(self, was=True): + def install_bouquet(self, was=True): logger.info("...") curr = self["liste"].getCurrent() + logger.debug("curr: %s", curr) if was and curr and len(curr) >= 5: bouquet = curr[3] mytyp = curr[5] - prevideo = _tv_config_config.get('prevideomode', _premode) - # intpremode = _premode.index(prevideo[0]), _premode.index(prevideo[1]), _premode.index(prevideo[2]) result = [] resultlen = 0 servicetypes = curr[2] + ' ORDER BY name' if bouquet not in self.masterliste: self.masterliste[bouquet] = {} - self.masterliste[bouquet]['resultlen'] = 0 - ServiceList = getServiceList(servicetypes) - - if ServiceList: - for (service, ename) in ServiceList: + service_list = getServiceList(servicetypes) + logger.debug("service_list: %s", service_list) + if service_list: + for service, ename in service_list: self.masterliste[bouquet][service] = {} self.masterliste[bouquet][service]['ename'] = ename self.masterliste[bouquet][service]['position'] = resultlen - self.masterliste[bouquet][ename] = {'ename': ename, 'service': service, 'position': resultlen} resultlen += 1 - self.masterliste[bouquet]['resultlen'] = resultlen - - if 'tvdefault' not in self.masterliste: - self.masterliste['tvdefault'] = {} - self.masterliste['tvdefault'] = read_file_tvdefault() - mdict = self.masterliste[bouquet] - eallname = 'Alle_Sender__Enigma_' - cvmode = checkvideomode() - - def add_notfound(val, res): - logger.info("...") - if val in self.masterliste['notfound']: - self.masterliste['notfound'][val].update(res) - else: - self.masterliste['notfound'][val] = res - - mytime = datetime.now() - - def check_debug(eservice, value): - logger.info("...") - if value[eservice] and value[eservice] in mdict: - tmp = [value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value[prevideodict[eservice]].encode('utf-8'), value[eservice].encode('utf-8'), is_in_fovo(value['id']), mdict[value[eservice]]['position']] - result.append(tmp) - return True - if (value[eservice] and value[eservice] not in mdict): - if value[prevideodict[eservice]] in mdict: - vservice = mdict[value[prevideodict[eservice]]]['service'].encode('utf-8') - position = mdict[value[prevideodict[eservice]]]['position'] - tmp = [value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value[prevideodict[eservice]].encode('utf-8'), vservice, is_in_fovo(value['id']), position] - result.append(tmp) - res = value.copy() - res.update({'namefound': value[prevideodict[eservice]], 'bouquet': bouquet, 'date': mytime.strftime("%H:%M %d-%m-%Y")}) - res.update({'update' + eservice: vservice}) - add_notfound(value['id'], res) - # print value[prevideodict[eservice]], vservice, position - return True - if value['tname'] in mdict: - vservice = mdict[value['tname']]['service'].encode('utf-8') - position = mdict[value['tname']]['position'] - tmp = [value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value['tname'].encode('utf-8'), vservice, is_in_fovo(value['id']), position] - result.append(tmp) - res = value.copy() - res.update({'tnamefound': value['tname'], 'bouquet': bouquet, 'date': mytime.strftime("%H:%M %d-%m-%Y")}) - res.update({'update' + eservice: vservice}) - add_notfound(value['id'], res) - # print value['tname'] - return True - if (eallname in self.masterliste and value[eservice] not in self.masterliste[eallname]): - res = value.copy() - res.update({'namefoundlast': value[prevideodict[eservice]], 'bouquet': bouquet, 'date': mytime.strftime("%H:%M %d-%m-%Y")}) - add_notfound(value['id'], res) - return False - return False - - def check_eservice(eservice, value): - logger.info("...") - if value[eservice] and value[eservice] in mdict: - oldename = value[prevideodict[eservice]] - oldeservice = value[eservice] - cvmode.getresult(value) - if oldeservice == cvmode.eservice: - cvmode.ename = mdict[value[eservice]]['ename'] - elif oldename != cvmode.ename: - service_ename = ServiceReference(cvmode.eservice).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') - cvmode.ename = service_ename - if cvmode.ename and cvmode.eservice: - tmp = [value['tname'].encode('utf-8'), value['id'].encode('utf-8'), cvmode.ename, cvmode.eservice, is_in_fovo(value['id']), mdict[value[eservice]]['position']] - result.append(tmp) - return True - else: - def replaceservice(service): - logger.info("...") - return service.replace('C00000', '0xFFFF0000') - - keservice = replaceservice(value[eservice]) - if keservice and keservice in mdict: - valueres = value.copy() - valueres['servicesd'] = replaceservice(value['servicesd']) - valueres['servicehd'] = replaceservice(value['servicehd']) - valueres['serviceuhd'] = replaceservice(value['serviceuhd']) - cvmode.getresult(valueres) - tmp = [value['tname'].encode('utf-8'), value['id'].encode('utf-8'), cvmode.ename, cvmode.eservice, is_in_fovo(value['id']), mdict[keservice]['position']] - result.append(tmp) - res = value.copy() - res.update({'cable' + eservice: keservice, 'updatecable': value[prevideodict[eservice]], 'bouquet': bouquet, 'date': mytime.strftime("%H:%M %d-%m-%Y")}) - add_notfound(value['id'], res) - return True - return False - - for _name, value in self.masterliste['tvdefault']: - if check_eservice(prevideo[0], value): - continue - if check_eservice(prevideo[1], value): - continue - if check_eservice(prevideo[2], value): - continue - if check_debug(prevideo[0], value): - continue - if check_debug(prevideo[1], value): - continue - if check_debug(prevideo[2], value): - continue - - if len(result) > 0: - self.listtype = 'addfavo' - _tv_config['channel_bouquet'][bouquet] = {'name': bouquet, 'disname': curr[0], 'typ': curr[5], 'id': ''} - _tv_config['channel'][bouquet] = _tv_config['channel_bouquet'][bouquet] - filename = curr[4] - if 'eall' in mytyp: - if 'leng' in _channelcache['default']: - _ch = _channelcache['default'].get - result.sort(key=lambda x: _ch(x[1], _ch('leng'))) - else: - result.sort(key=lambda x: x[0]) - else: - result.sort(key=lambda x: x[5]) - write_channels(filename, result) - _changed['config'] = True - _channelcache['bouq'].clear() - - self["liste"].style = "channel_bouquet" - self["liste"].setList(result) - for myx in self.mytitlestr: - self[myx].show() - self["mytitle5"].text = _('Favourites') - self["message"].setText("%s %s %s: (%d/%d)" % (_("Installation finished."), curr[0], _("Entries"), len(result), self.masterliste[bouquet]['resultlen'])) + logger.debug("masterliste[bouquet]: %s", self.masterliste[bouquet]) + self.key_green(bouquet) def cleanname(self, msg): logger.info("...") diff --git a/src/ChannelUtils.py b/src/ChannelUtils.py new file mode 100755 index 0000000..9cec24c --- /dev/null +++ b/src/ChannelUtils.py @@ -0,0 +1,73 @@ +import os +import json +from six import text_type +from Tools.Directories import resolveFilename, SCOPE_CONFIG, pathExists +from .ConfigInit import plugindir +from .Debug import logger + + +def convert_unicode_to_str(input_data): + if isinstance(input_data, dict): + return {convert_unicode_to_str(key): convert_unicode_to_str(value) for key, value in input_data.iteritems()} + if isinstance(input_data, list): + return [convert_unicode_to_str(element) for element in input_data] + if isinstance(input_data, text_type): + return input_data.encode('utf-8') + return input_data + + +def read_channel_list(bouquet="default"): + logger.info("bouquet: %s", bouquet) + channel_list = [] + channel_list_filename = "tvspielfilm_channel_list_%s.json" % bouquet + path = os.path.join(resolveFilename(SCOPE_CONFIG), channel_list_filename) + if pathExists(path): + filename = path + else: + path = os.path.join(plugindir, channel_list_filename) + if pathExists(path): + filename = path + logger.debug("filename: %s", filename) + if filename: + with open(filename) as data_file: + channel_list = convert_unicode_to_str(json.load(data_file)) + logger.debug("channel_list: %s", channel_list) + return channel_list + + +def write_channel_list(bouquet, channel_list): + logger.info("bouquet: %s", bouquet) + channel_list_filename = "tvspielfilm_channel_list_%s.json" % bouquet + path = os.path.join(resolveFilename(SCOPE_CONFIG), channel_list_filename) + with open(path, 'w') as afile: + json.dump(channel_list, afile, indent=2) + + +def read_channel_dict(channel_list=None, resolution="hd"): + logger.info("resolution: %s", resolution) + channel_dict = {} + channel_list = channel_list if channel_list is not None else [] + filename = "" + channel_dict_filename = "tvspielfilm_channel_dict_default.json" + path = os.path.join(resolveFilename(SCOPE_CONFIG), channel_dict_filename) + if pathExists(path): + filename = path + else: + path = os.path.join(plugindir, channel_dict_filename) + if pathExists(path): + filename = path + logger.debug("filename: %s", filename) + if filename: + with open(filename) as data_file: + channels = convert_unicode_to_str(json.load(data_file)) + if channels: + if not channel_list: + channel_list = channels.keys() + logger.debug("channel_list: %s", channel_list) + for channel_id in channel_list: + channel_dict[channel_id] = {} + channel_dict[channel_id]['tname'] = channels[channel_id]['tname'] + channel_dict[channel_id]['ename'] = channels[channel_id]['ename%s' % resolution] + channel_dict[channel_id]['service'] = channels[channel_id]['service%s' % resolution] + logger.debug("channel_dict: %s", channel_dict) + return channel_dict diff --git a/src/Downloader.py b/src/Downloader.py index f9d4a2d..c0a2802 100755 --- a/src/Downloader.py +++ b/src/Downloader.py @@ -75,18 +75,18 @@ def __del__(self): class MyDeferredSemaphore: def __init__(self, tokens=1): logger.info("...") - self._ds = DeferredSemaphore(tokens=tokens) + self.ds = DeferredSemaphore(tokens=tokens) self._deferreds = [] self.work = dict() _downloads['state'] = True def run(self, *args, **kwargs): logger.info("...") - return self._ds.run(*args, **kwargs) + return self.ds.run(*args, **kwargs) def rundeferLater(self, ltime=0.0, *args, **kwargs): logger.info("...") - return deferLater(reactor, ltime, self._ds.run, *args, **kwargs) + return deferLater(reactor, ltime, self.ds.run, *args, **kwargs) def start(self, *args, **kwargs): logger.info("...") @@ -94,17 +94,17 @@ def start(self, *args, **kwargs): def deferCanceler(self, _cancel=True): logger.info("...") - for items in self._ds.waiting: + for items in self.ds.waiting: items.cancel() def settokens(self, tokens=10): logger.info("...") - self._ds.tokens = tokens - self._ds.limit = tokens + self.ds.tokens = tokens + self.ds.limit = tokens def finished(self): logger.info("...") - return self._ds.tokens >= self._ds.limit + return self.ds.tokens >= self.ds.limit def __del__(self): logger.info("...") diff --git a/src/EasyMenu.py b/src/EasyMenu.py index 91005c4..1f1f9a9 100755 --- a/src/EasyMenu.py +++ b/src/EasyMenu.py @@ -4,7 +4,7 @@ from .tvspielfilmsetup import TvSpielfilmstartSetup from .tvspielfilmsetup import TvSpielfilmmainSetup from .tvspielfilmsetup import TvSpielfilmsearchSetup -from .TvSpielfilmchannel import TvSpielfilmchannel +from .ChannelManagement import ChannelManagement from .tvconfig import make_default_string, read_ServiceReference from ._tvdict import _changed, _channelreference, _tv_config @@ -47,7 +47,7 @@ def openEasyMenuCallback(self, next_screen=None): elif next_screen[1] == 'search': self.key_search() elif next_screen[1] == 'tvchannel': - self.session.open(TvSpielfilmchannel) + self.session.open(ChannelManagement) elif next_screen[1] == 'startsetup': self.session.open(TvSpielfilmstartSetup) elif next_screen[1] == "mainsetup": @@ -55,7 +55,7 @@ def openEasyMenuCallback(self, next_screen=None): elif next_screen[1] == "searchsetup": self.session.open(TvSpielfilmsearchSetup) elif next_screen[1] == "tvchannel": - self.session.openWithCallback(self.key_channel_back, TvSpielfilmchannel) + self.session.openWithCallback(self.key_channel_back, ChannelManagement) def key_menu_back(self, changed=False): logger.info("...") diff --git a/src/MYList.py b/src/MYList.py index 4190ff6..f495a8e 100644 --- a/src/MYList.py +++ b/src/MYList.py @@ -11,7 +11,7 @@ def __init__(self, alist=None, enableWrapAround=False, item_height=25, fonts=Non fonts = [] List.__init__(self, list=alist, enableWrapAround=enableWrapAround, item_height=item_height, fonts=fonts, buildfunc=buildfunc) - def extList(self, alist): + def extendList(self, alist): logger.info("...") self.list.extend(alist) self.changed((self.CHANGED_ALL, )) diff --git a/src/ProgramColumns.py b/src/ProgramColumns.py index b1297fb..460913d 100755 --- a/src/ProgramColumns.py +++ b/src/ProgramColumns.py @@ -1,5 +1,6 @@ # coding=utf-8 +import os import json from time import strftime, localtime, time as nowtime from datetime import datetime, timedelta @@ -10,9 +11,10 @@ from Components.Label import Label from Components.Pixmap import Pixmap from Components.Sources.StaticText import StaticText +from Tools.LoadPixmap import LoadPixmap from .Downloader import headers_gzip, MygetPage, MydownloadPage, http_failed, MyDeferredSemaphore from .tools import Load_My_Pixmap, mastxval_list, listmainindex -from ._tvdict import _events, listprogindex, listprogresindex +from ._tvdict import listprogindex, listprogresindex from .ConfigInit import plugindir from .MultiListSummary import MultiListSummary from .MYSimpleSummary import MYSimpleSummary @@ -30,6 +32,7 @@ listprogres[listprogresindex['index']] = 0 _masterdict = {} +_events = {} class ProgramColumns(Screen, EasyMenu): @@ -90,12 +93,12 @@ def __init__(self, session, channel_list, channel_dict): self.first = False self.mytimecount = 1 mytime = int(nowtime()) - self["searchdate"].text = strftime("< %A, %d. %b %y >", localtime(mytime)) + self["searchdate"].text = strftime("< %A, %d. %b %Y >", localtime(mytime)) self.date_string = strftime("&date=%Y-%m-%d") mytime = mytime - 24 * 60 * 60 self.timelist = [] for _page in range(0, 15): - self.timelist.append([strftime("< %A, %d. %b %y >", localtime(mytime)), strftime("&date=%Y-%m-%d", localtime(mytime))]) + self.timelist.append([strftime("< %A, %d. %b %Y >", localtime(mytime)), strftime("&date=%Y-%m-%d", localtime(mytime)), strftime("%Y-%m-%d", localtime(mytime))]) mytime = mytime + 24 * 60 * 60 self["key_red"] = StaticText("TV Spielfilm Main") @@ -103,8 +106,7 @@ def __init__(self, session, channel_list, channel_dict): self["key_yellow"] = StaticText(_("Search")) self["key_blue"] = StaticText(_("Reload")) - self.download = MyDeferredSemaphore(tokens=6) - self.download2 = MyDeferredSemaphore(tokens=6) + self.download = MyDeferredSemaphore(tokens=12) self.onClose.append(self.__onClose__) self.firststart() @@ -113,8 +115,6 @@ def firststart(self): logger.info("...") logger.debug("self.channel_list: %s", self.channel_list) self.first = True - # if not _channelreference: - # read_ServiceReference() self.key_blue() def download_page(self): @@ -133,11 +133,11 @@ def download_page(self): stop = min(start + 6, len(self.channel_list)) self.page_list = self.channel_list[start:stop] logger.debug("page_list: %s", self.page_list) + del self.download.ds.waiting[:] for channel_id in self.page_list: logger.info("channel_id: %s", channel_id) - day = (datetime.now() + timedelta(days=0)).strftime("%Y-%m-%d") + day = self.timelist[self.mytimecount][2] url = "https://live.tvspielfilm.de/static/broadcast/list/%s/%s" % (channel_id, day) - del self.download._ds.waiting[:] self.download.run(MygetPage, url, headers=headers_gzip).addCallback(self.result_back, channel_id, len(self.page_list)).addErrback(http_failed) def result_back(self, result, channel_id, page_list_len): @@ -241,19 +241,18 @@ def set_values(self): logger.debug("propix url: %s", url) afile = '/tmp/programmpix%d%s' % (index, url[-4:]) if url: - self.download2.run(MydownloadPage, url, afile, headers=headers_gzip).addCallback(self.result_back2, index, afile).addErrback(http_failed) + self.download.run(MydownloadPage, url, afile, headers=headers_gzip).addCallback(self.result_back_pic, index, afile).addErrback(http_failed) url = str(image.get("size1", "")) self[listeval].l.setList(tmp_list) self[self.listvalue[index]].moveToIndex(now_index) self.update_Title() self.update_liste() - def result_back2(self, result, index, event_pic_file): + def result_back_pic(self, result, index, event_pic_file): logger.info("result: %s", result) logger.info("index: %s, event_pic_file: %s", index, event_pic_file) - propix = "programmpix{0}".format(index) - ptr = Load_My_Pixmap(event_pic_file) - self[propix].instance.setPixmap(ptr) + self["programmpix%s" % index].instance.setPixmap(LoadPixmap(event_pic_file)) + os.remove(event_pic_file) def update_Title(self): logger.info("...") @@ -267,7 +266,6 @@ def createSummary(self): def update_liste(self): logger.info("...") - return curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() if curr and _masterdict: rindex = listprogresindex @@ -308,14 +306,6 @@ def clear_values(self): self[listeval].l.setList([]) self[propix].instance.setPixmap(gPixmapPtr()) - def clear_propix_values(self): - logger.info("...") - for index in range(self.listleng): - propix = "programmpix{0}".format(index) - descriptionval = "description{0}".format(index) - if self[descriptionval].getVisible(): - self[propix].instance.setPixmap(gPixmapPtr()) - def left(self): logger.info("...") self[self.listvalue[self.listindex]].setSelectionEnable(False) @@ -361,6 +351,32 @@ def moveDown(self): self[self.listvalue[self.listindex]].moveDown() self.update_liste() + def channelup(self): + logger.info("...") + self[self.listvalue[self.listindex]].setSelectionEnable(False) + self.page_index += 1 + if self.page_index >= self.pagesnumbers: + self.page_index = 0 + self.listindex = 0 + self[self.listvalue[self.listindex]].setSelectionEnable(True) + self.key_blue() + self.update_Title() + self.update_liste() + + def channeldown(self): + logger.info("...") + self[self.listvalue[self.listindex]].setSelectionEnable(False) + self.page_index -= 1 + if self.page_index < 0: + self.page_index = self.pagesnumbers - 1 + self.listindex = self.listleng - 1 if len(self.channel_list) % self.listleng == 0 else len(self.channel_list) % self.listleng - 1 + else: + self.listindex = self.listleng - 1 + self.key_blue() + self[self.listvalue[self.listindex]].setSelectionEnable(True) + self.update_Title() + self.update_liste() + def showMenu(self): logger.info("...") if self.download.finished(): @@ -396,32 +412,6 @@ def key_easymenu(self): logger.info("...") self.openEasyMenu(self.session) - def channelup(self): - logger.info("...") - self[self.listvalue[self.listindex]].setSelectionEnable(False) - self.page_index += 1 - if self.page_index >= self.pagesnumbers: - self.page_index = 0 - self.listindex = 0 - self[self.listvalue[self.listindex]].setSelectionEnable(True) - self.key_blue() - self.update_Title() - self.update_liste() - - def channeldown(self): - logger.info("...") - self[self.listvalue[self.listindex]].setSelectionEnable(False) - self.page_index -= 1 - if self.page_index < 0: - self.page_index = self.pagesnumbers - 1 - self.listindex = self.listleng - 1 if len(self.channel_list) % self.listleng == 0 else len(self.channel_list) % self.listleng - 1 - else: - self.listindex = self.listleng - 1 - self.key_blue() - self[self.listvalue[self.listindex]].setSelectionEnable(True) - self.update_Title() - self.update_liste() - def key_next(self): logger.info("...") self.mytimecount += 1 @@ -442,29 +432,23 @@ def key_back(self): def key_ok(self): logger.info("...") - return - try: - curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() - rindex = listprogresindex - if curr and curr[rindex['channelurl']].startswith('http'): - resu = mastxval_list[:] - resu[listmainindex['channel']] = _masterdict[curr[rindex['id']]]['channel'] - resu[listmainindex['title']] = curr[rindex['title']] - resu[listmainindex['tvsearch']] = curr[rindex['subtitle']] - resu[listmainindex['channelpix']] = _masterdict[curr[rindex['id']]]['channelpix'] - resu[listmainindex['id']] = curr[rindex['id']] - resu[listmainindex['urlsendung']] = curr[rindex['channelurl']] - resu[listmainindex['daumen']] = curr[rindex['daumen']] - resu[listmainindex['neu']] = curr[rindex['neu']] - resu[listmainindex['tipp']] = curr[rindex['tipp']] - try: - tring = self.date_string[6:] + '-' + curr[rindex['time']] - resu[listmainindex['datastart']] = int(datetime.strptime(tring, '%Y-%m-%d-%H:%M').strftime("%s")) - except Exception: - pass - self.session.open(TvSpielfilmView, resu) - except Exception: - pass + curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() + logger.debug("curr: %s", curr) + rindex = listprogresindex + resu = mastxval_list[:] + if curr and curr[rindex['channelurl']].startswith('http'): + resu[listmainindex['channel']] = _masterdict[curr[rindex['id']]]['channel'] + resu[listmainindex['title']] = curr[rindex['title']] + resu[listmainindex['tvsearch']] = curr[rindex['subtitle']] + resu[listmainindex['channelpix']] = _masterdict[curr[rindex['id']]]['channelpix'] + resu[listmainindex['id']] = curr[rindex['id']] + resu[listmainindex['urlsendung']] = curr[rindex['channelurl']] + resu[listmainindex['daumen']] = curr[rindex['daumen']] + resu[listmainindex['neu']] = curr[rindex['neu']] + resu[listmainindex['tipp']] = curr[rindex['tipp']] + tring = self.date_string[6:] + '-' + curr[rindex['time']] + resu[listmainindex['datastart']] = int(datetime.strptime(tring, '%Y-%m-%d-%H:%M').strftime("%s")) + self.session.open(TvSpielfilmView, resu) def key_red(self): logger.info("...") @@ -495,9 +479,8 @@ def key_blue(self): def __onClose__(self): logger.info("...") self.download.deferCanceler() - self.download2.deferCanceler() - del self.download._ds.waiting[:] - del self.download2._ds.waiting[:] + del self.download.ds.waiting[:] self.download.work.clear() self.channel_dict.clear() _masterdict.clear() + _events.clear() diff --git a/src/TVMagazineCockpit.py b/src/TVMagazineCockpit.py index d39c644..4f9cd3b 100644 --- a/src/TVMagazineCockpit.py +++ b/src/TVMagazineCockpit.py @@ -22,12 +22,11 @@ from Components.config import config from .Debug import logger from .TvSpielfilmmain import TvSpielfilmmain -from .tvspielfilmtvprogramm import TvSpielfilmTvProgramm from .tvspielfilmtipps import TvSpielfilmTipps -from .tvspielfilmtvprogramm import TvSpielfilmTvProgrammsky from .ProgramColumns import ProgramColumns from .TvSpielfilmsearch import TvSpielfilmsearch -from .tvconfig import read_tvconfig, read_channel_favo_prog +from .tvconfig import read_tvconfig +from .ChannelUtils import read_channel_list, read_channel_dict class TVMagazineCockpit(): @@ -56,11 +55,20 @@ def showScreenCallback(self, *args): elif return_screen == "main": self.showScreen(TvSpielfilmmain) elif return_screen == "programm": - self.showScreen(TvSpielfilmTvProgramm) + channel_list = read_channel_list("default") + channel_dict = read_channel_dict() + logger.debug("channel_list: %s", channel_list) + logger.debug("channel_dict: %s", channel_dict) + self.showScreen(ProgramColumns, channel_list, channel_dict) elif return_screen == "programmsky": - self.showScreen(TvSpielfilmTvProgrammsky) + channel_list = read_channel_list("sky") + channel_dict = read_channel_dict() + logger.debug("channel_list: %s", channel_list) + logger.debug("channel_dict: %s", channel_dict) + self.showScreen(ProgramColumns, channel_list, channel_dict) elif return_screen == "programmfavo": - channel_list, channel_dict = read_channel_favo_prog() + channel_list = read_channel_list("favorites") + channel_dict = read_channel_dict() logger.debug("channel_list: %s", channel_list) logger.debug("channel_dict: %s", channel_dict) self.showScreen(ProgramColumns, channel_list, channel_dict) diff --git a/src/TvSpielfilmView.py b/src/TvSpielfilmView.py index 8e1cb3f..486fb88 100755 --- a/src/TvSpielfilmView.py +++ b/src/TvSpielfilmView.py @@ -29,9 +29,8 @@ class TvSpielfilmView(Screen): def __init__(self, session, mlist): logger.info("...") - self.skinName = "TvSpielfilmView" Screen.__init__(self, session) - + self.skinName = "TvSpielfilmView" self["description"] = ScrollLabel() self["actions"] = ActionMap( ["TVS_Actions"], @@ -66,7 +65,7 @@ def __init__(self, session, mlist): self["remaining"] = Label() self["duration"] = Label() self["trailer"] = Boolean(False) - self["liste"] = MultiListSummary(mlist[:]) # lcd + self["liste"] = MultiListSummary(mlist[:]) self.filename = '' self.videourl = '' diff --git a/src/TvSpielfilmmain.py b/src/TvSpielfilmmain.py index e638edd..4547505 100755 --- a/src/TvSpielfilmmain.py +++ b/src/TvSpielfilmmain.py @@ -12,7 +12,7 @@ from Components.UsageConfig import preferredTimerPath from Downloader import headers_gzip, MygetPage, http_failed, MyDeferredSemaphore, _downloads as _state_ from tools import listmainindex as mindex, tvspielfilm_parse -from tvconfig import write_tvconfig, make_order_string +from tvconfig import read_tvconfig, write_tvconfig, make_order_string from _tvdict import _changed, _tv_config, _channelcache, _channelreference, _pixmap_cache from enigma import eEPGCache from enigma import eServiceReference @@ -87,8 +87,8 @@ def createSummary(self): def firststart(self): logger.info("...") - # if not _tv_config.has_key('date_string'): - # read_tvconfig() + if not _tv_config.has_key('date_string'): + read_tvconfig() _tv_config['date_string'] = strftime("&date=%Y-%m-%d") if _tv_config.get('time').get('default'): @@ -194,7 +194,7 @@ def result_back(self, result, pagenumber=1): if 'cancel' in self.download.work: self["message"].text = '{0}'.format('Cancelling...') else: - self["liste"].extList(val) + self["liste"].extendList(val) self["message"].text = '{0} {1}: {2} {3}: {4}'.format(_('Loading...'), _('Page:'), pagenumber, _('Entries'), self["liste"].count()) if pageres: diff --git a/src/TvSpielfilmsearch.py b/src/TvSpielfilmsearch.py index 03d8aeb..bb9afff 100755 --- a/src/TvSpielfilmsearch.py +++ b/src/TvSpielfilmsearch.py @@ -105,7 +105,7 @@ def result_back(self, result, pagenumber=1): if 'cancel' in self.download.work: self["message"].text = '{0}'.format(_('Cancelling...')) else: - self["liste"].extList(val) + self["liste"].extendList(val) self["message"].text = '{0} {1} {2} {3}: {4}'.format(_('Loading...'), _('Page:'), pagenumber, _('Entries'), self["liste"].count()) if pageres: for url, page in pageres: diff --git a/src/Version.py b/src/Version.py index 1d032be..714791a 100644 --- a/src/Version.py +++ b/src/Version.py @@ -21,6 +21,6 @@ PLUGIN = "TVMagazineCockpit" ID = "TVC" -VERSION = "0.6.0" +VERSION = "0.7.0" COPYRIGHT = "2018-2024 by dream-alpha" LICENSE = "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version." diff --git a/src/locale/de/LC_MESSAGES/TVMagazineCockpit.mo b/src/locale/de/LC_MESSAGES/TVMagazineCockpit.mo index 9119cbe..6debeff 100644 Binary files a/src/locale/de/LC_MESSAGES/TVMagazineCockpit.mo and b/src/locale/de/LC_MESSAGES/TVMagazineCockpit.mo differ diff --git a/src/tvspielfilm_default_channels.json b/src/org_channels.json similarity index 100% rename from src/tvspielfilm_default_channels.json rename to src/org_channels.json diff --git a/src/tvconfig.py b/src/tvconfig.py index 9e20dc7..61ae0a4 100644 --- a/src/tvconfig.py +++ b/src/tvconfig.py @@ -251,8 +251,7 @@ def read_file_channels(filename): logger.info("...") if pathExists(filename): with open(filename) as data_file: - data = json.load(data_file, encoding='utf-8') - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: return channels return None @@ -267,53 +266,33 @@ def read_file_tvdefault(withoutvallue=False): filename = configdefaultchannels if pathExists(filename): with open(filename) as data_file: - data = json.load(data_file, encoding='utf-8') - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels and withoutvallue: return channels if channels: - for (name, value) in channels: + for name, value in channels.iteritems(): if value['servicesd'] or value['servicehd'] or value['serviceuhd']: result.append([name, value]) return result return result -def convert_channels_list_to_dict(data, typ=''): - logger.info("...") - result = {} - result['channels'] = [] - result['typ'] = typ - if len(data) > 0: - for x in data: - res = {} - res['tname'] = x[0] - res['id'] = x[1] - res['ename'] = x[2] - res['service'] = x[3] - result['channels'].append([x[1], res]) - return result - - def read_channel(file, _retresult=""): logger.info("...") if pathExists(file): with open(file) as data_file: - data = json.load(data_file, encoding='utf-8') - if isinstance(data, list): - data = convert_channels_list_to_dict(data) - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: _tv_config['channel_string'] = '&channel=' counter = 0 channelslen = len(channels) - 1 _channelcache['bouq'] = {} - for _key, value in channels: + for key, value in channels.iteritems(): if value.has_key('id') and value.has_key('service'): _tv_config['channel_string'] += value['id'].encode('utf-8') if counter < channelslen: _tv_config['channel_string'] += '%2C' - _channelcache['bouq'][value['id']] = counter + _channelcache['bouq'][key] = counter counter += 1 _channelcache['bouq']['leng'] = counter + 1 @@ -329,20 +308,49 @@ def read_channel_favo_prog(file_name='favourites'): logger.info("...") if pathExists(channels_file_name(file_name)): with open(channels_file_name(file_name)) as data_file: - data = json.load(data_file, encoding='utf-8') - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: channellist = [] channeldict = {} counter = 0 - for _key, value in channels: + for key, value in channels.iteritems(): channellist.append(value['id'].encode('utf-8')) - channeldict[value['id']] = {} - channeldict[value['id']]['id'] = value['id'] - channeldict[value['id']]['ename'] = value['ename'].encode('utf-8') - channeldict[value['id']]['tname'] = value['tname'].encode('utf-8') - channeldict[value['id']]['service'] = value['service'] - channeldict[value['id']]['index'] = counter + channeldict[key] = {} + channeldict[key]['ename'] = value['ename'].encode('utf-8') + channeldict[key]['tname'] = value['tname'].encode('utf-8') + channeldict[key]['service'] = value['service'] + channeldict[key]['index'] = counter + counter += 1 + + return channellist, channeldict + return None, None + + +def read_default_channels_prog(resolution="hd"): + logger.info("...") + if pathExists(configdefaultchannelsuser): + return read_channel_default_prog(configdefaultchannelsuser, resolution) + if pathExists(configdefaultchannels): + return read_channel_default_prog(configdefaultchannels, resolution) + return None + + +def read_channel_default_prog(file_name, resolution="hd"): + logger.info("...") + if pathExists(channels_file_name(file_name)): + with open(channels_file_name(file_name)) as data_file: + channels = json.load(data_file, encoding='utf-8') + if channels: + channellist = [] + channeldict = {} + counter = 0 + for key, value in channels.iteritems(): + channellist.append(value['id'].encode('utf-8')) + channeldict[key] = {} + channeldict[key]['ename'] = value['ename'].encode('utf-8') + channeldict[key]['tname'] = value['tname'].encode('utf-8') + channeldict[key]['service'] = value['service'] + channeldict[key]['index'] = counter counter += 1 return channellist, channeldict @@ -353,20 +361,17 @@ def read_channel_favo(): logger.info("...") if pathExists(channels_file_name('favourites')): with open(channels_file_name('favourites')) as data_file: - data = json.load(data_file, encoding='utf-8') - if isinstance(data, list): - data = convert_channels_list_to_dict(data) - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: _tv_config['channel_string'] = '&channel=' counter = 0 channelslen = len(channels) - 1 _channelcache['favo'] = {} - for _key, value in channels: - _tv_config['channel_string'] += value['id'].encode('utf-8') + for key, value in channels.iteritems(): + _tv_config['channel_string'] += key.encode('utf-8') if counter < channelslen: _tv_config['channel_string'] += '%2C' - _channelcache['favo'][value['id']] = counter + _channelcache['favo'][key] = counter counter += 1 _channelcache['favo']['leng'] = counter + 1 @@ -375,52 +380,46 @@ def read_channel_list_favo(): logger.info("...") if pathExists(channels_file_name('favourites')): with open(channels_file_name('favourites')) as data_file: - data = json.load(data_file, encoding='utf-8') - if isinstance(data, list): - data = convert_channels_list_to_dict(data) - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: result = [] counter = 0 _channelcache['favo'] = {} - for _key, value in channels: + for key, value in channels.iteritems(): enameval = '' ename = ServiceReference(str(value['service'])).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '') if not ename: enameval = _('not found') elif value['ename'] != ename: enameval = ename - result.append([value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), enameval]) - _channelcache['favo'][value['id']] = counter + result.append([value['tname'].encode('utf-8'), key.encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), enameval]) + _channelcache['favo'][key] = counter counter += 1 _channelcache['favo']['leng'] = counter + 1 return result return [] -def read_channel_list(file, favocheck=True): +def tv_read_channel_list(file, favocheck=True): logger.info("...") if pathExists(file): with open(file) as data_file: - data = json.load(data_file, encoding='utf-8') - if isinstance(data, list): - data = convert_channels_list_to_dict(data) - channels = data.get('channels') + channels = json.load(data_file, encoding='utf-8') if channels: result = [] counter = 0 - for _key, value in channels: + for key, value in channels.iteritems(): if favocheck: - result.append([value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), is_in_fovo(value['id'])]) + result.append([value['tname'].encode('utf-8'), key.encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), is_in_fovo(value['id'])]) else: - result.append([value['tname'].encode('utf-8'), value['id'].encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), '']) + result.append([value['tname'].encode('utf-8'), key.encode('utf-8'), value['ename'].encode('utf-8'), value['service'].encode('utf-8'), '']) counter += 1 return result return None def read_default_channels_res(filename, retresult=False): - logger.info("...") + logger.info("filename: %s", filename) result = [] if _tv_config_config not in ('prevideomode', 'picondir') and pathExists(configfile): with open(configfile) as conf_file: @@ -431,24 +430,21 @@ def read_default_channels_res(filename, retresult=False): _tv_config_config['picondir'] = cdata['picondir'].encode('utf-8') if pathExists(filename): with open(filename) as data_file: - data = json.load(data_file) - if isinstance(data, list): - return None - channels = data.get('channels') + channels = json.load(data_file) if channels: _channelcache['default'] = {} cvmode = checkvideomode() counter = 0 - for _key, value in channels: - _channelcache['default'][value['id']] = counter + for key, value in channels.iteritems(): + _channelcache['default'][key] = counter counter += 1 if retresult: update_ename(value) cvmode.getresult(value) if cvmode.ename and cvmode.eservice: - _channelreference[value['id']] = cvmode.eservice + _channelreference[key] = cvmode.eservice if retresult: - result.append([value['tname'].encode('utf-8'), value['id'].encode('utf-8'), cvmode.ename, cvmode.eservice, is_in_fovo(value['id']), value]) + result.append([value['tname'].encode('utf-8'), key.encode('utf-8'), cvmode.ename, cvmode.eservice, is_in_fovo(key), value]) _channelcache['default']['leng'] = counter + 1 if retresult: return result @@ -459,10 +455,7 @@ def read_favourites_position(): logger.info("...") if not _channelcache['favo']: with open(channels_file_name('favourites')) as data_file: - data = json.load(data_file) - if isinstance(data, list): - data = convert_channels_list_to_dict(data) - channels = data.get('channels') + channels = json.load(data_file) if channels: _channelcache['favo'] = {} counter = 0 @@ -540,18 +533,30 @@ def write_channels(file, result, typ=''): json.dump(result, fp, encoding='utf-8', indent=2, sort_keys=True) +def convert_channels_list_to_dict(data, typ=''): + logger.info("data: %s", data) + result = {} + if len(data) > 0: + for x in data: + logger.debug("x: %s", x) + res = {} + res['tname'] = x[0] + res['ename'] = x[2] + res['service'] = x[3] + result[x[1]] = res + return result + + def write_default_channels(file, result): logger.info("...") tmp = {} - tmp['channels'] = [] - tmp['typ'] = 'tvdefault' _channelcache['default'] = {} counter = 0 for x in result: value = x[5] _channelcache['default'][value['id']] = counter counter += 1 - tmp['channels'].append((value['id'], value)) + tmp.append((value['id'], value)) _channelcache['default']['leng'] = counter + 1 with open(file, 'w') as fp: json.dump(tmp, fp, encoding='utf-8', indent=2, sort_keys=True) diff --git a/src/tvspielfilm_channel_dict_default.json b/src/tvspielfilm_channel_dict_default.json new file mode 100644 index 0000000..40eb3f2 --- /dev/null +++ b/src/tvspielfilm_channel_dict_default.json @@ -0,0 +1,1866 @@ +{ + "PASS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "RTL Passion", + "enamehd": "", + "enamesd": "" + }, + "SF2": { + "enameuhd": "", + "servicehd": "1:0:19:4332:300C:13E:820000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "SRF zwei", + "enamehd": "SRF zwei HD", + "enamesd": "" + }, + "SKY-H": { + "enameuhd": "", + "servicehd": "1:0:19:6B:C:85:C00000:0:0:0:", + "servicesd": "1:0:16:29:4:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Cinema Best Of", + "enamehd": "Sky Cinema Best Of HD", + "enamesd": "Sky Cinema Best Of" + }, + "SF1": { + "enameuhd": "", + "servicehd": "1:0:19:4331:300C:13E:820000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "SRF 1", + "enamehd": "SRF 1 HD", + "enamesd": "" + }, + "13TH": { + "enameuhd": "", + "servicehd": "1:0:19:7F:D:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "13th Street", + "enamehd": "13th Street HD", + "enamesd": "" + }, + "WDR": { + "enameuhd": "", + "servicehd": "1:0:19:6EAE:3FD:1:C00000:0:0:0:", + "servicesd": "1:0:1:6E92:4B1:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "WDR", + "enamehd": "WDR HD Bielefeld", + "enamesd": "WDR Bielefeld" + }, + "MASPO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Magenta Sport", + "enamehd": "", + "enamesd": "" + }, + "NHK": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:139D:3EA:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "NHK WORLD TV", + "enamehd": "", + "enamesd": "NHK WORLD-JPN" + }, + "BR": { + "enameuhd": "", + "servicehd": "1:0:19:2856:401:1:C00000:0:0:0:", + "servicesd": "1:0:1:6DCE:44D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "BR", + "enamehd": "BR Fernsehen Nord HD", + "enamesd": "BR Fernsehen Nord" + }, + "AXN": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:101D:451:35:C00000:0:0:0:", + "serviceuhd": "", + "tname": "AXN", + "enamehd": "", + "enamesd": "AXN Deutschland" + }, + "CNN-T": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "CNN T\u00fcrk", + "enamehd": "", + "enamesd": "" + }, + "3PLUS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:1260:3F7:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "3+", + "enamehd": "", + "enamesd": "3+" + }, + "HSE": { + "enameuhd": "", + "servicehd": "1:0:19:5270:41D:1:C00000:0:0:0:", + "servicesd": "1:0:1:28:21:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "HSE24", + "enamehd": "HSE HD", + "enamesd": "HSE SD" + }, + "FRA5": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:2330:442:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 5", + "enamehd": "", + "enamesd": "FRANCE 5" + }, + "FRA4": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:21FD:44C:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 4", + "enamehd": "", + "enamesd": "FRANCE 4" + }, + "FRA3": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:245D:440:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 3", + "enamehd": "", + "enamesd": "FRANCE 3" + }, + "FRA2": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:245A:440:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 2", + "enamehd": "", + "enamesd": "FRANCE 2" + }, + "RIC": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:32DB:45D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "RiC", + "enamehd": "", + "enamesd": "RiC" + }, + "JUKE": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:191:9:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Jukebox", + "enamehd": "", + "enamesd": "Jukebox" + }, + "RTLPL": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:2F30:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "RTLup", + "enamehd": "", + "enamesd": "RTLup" + }, + "SIXX": { + "enameuhd": "", + "servicehd": "1:0:19:EF77:3F9:1:C00000:0:0:0:", + "servicesd": "1:0:1:308:5:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "sixx", + "enamehd": "SIXX HD", + "enamesd": "SIXX" + }, + "RTL2": { + "enameuhd": "RTLII UHD", + "servicehd": "1:0:19:EF15:421:1:C00000:0:0:0:", + "servicesd": "1:0:1:2EF4:441:1:C00000:0:0:0:", + "serviceuhd": "1:0:1:3070:3F5:1:C00000:0:0:0:", + "tname": "RTL II", + "enamehd": "RTLZWEI HD", + "enamesd": "RTLZWEI" + }, + "TRAVELXP": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "travelxp 4K", + "enamehd": "", + "enamesd": "" + }, + "N24DOKU": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:30:5:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "N24 Doku", + "enamehd": "", + "enamesd": "N24 DOKU" + }, + "APLAN": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Animal Planet", + "enamehd": "", + "enamesd": "" + }, + "STTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "STAR TV", + "enamehd": "", + "enamesd": "" + }, + "TAG24": { + "enameuhd": "", + "servicehd": "1:0:19:2887:40F:1:C00000:0:0:0:", + "servicesd": "1:0:1:7031:41B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "tagesschau 24", + "enamehd": "tagesschau24 HD", + "enamesd": "tagesschau24" + }, + "GUSTO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BonGusto", + "enamehd": "", + "enamesd": "" + }, + "SONY": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Sony Channel", + "enamehd": "", + "enamesd": "" + }, + "DMAX": { + "enameuhd": "", + "servicehd": "1:0:19:151A:455:1:C00000:0:0:0:", + "servicesd": "1:0:1:3F:21:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "DMAX", + "enamehd": "DMAX HD", + "enamesd": "DMAX" + }, + "PHOEN": { + "enameuhd": "", + "servicehd": "1:0:19:285B:401:1:C00000:0:0:0:", + "servicesd": "1:0:1:7035:41B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "PHOENIX", + "enamehd": "phoenix HD", + "enamesd": "phoenix" + }, + "KIKA": { + "enameuhd": "", + "servicehd": "1:0:19:2B98:3F2:1:C00000:0:0:0:", + "servicesd": "1:0:1:6D68:437:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "KiKA", + "enamehd": "KiKA HD", + "enamesd": "KiKA" + }, + "TELE5": { + "enameuhd": "", + "servicehd": "1:0:19:1519:455:1:C00000:0:0:0:", + "servicesd": "1:0:1:33:21:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "TELE 5", + "enamehd": "TELE 5 HD", + "enamesd": "TELE 5" + }, + "DR1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "DR1", + "enamehd": "", + "enamesd": "" + }, + "GEO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "GEO Television", + "enamehd": "", + "enamesd": "" + }, + "WDWTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:332F:45B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Welt der Wunder TV", + "enamehd": "", + "enamesd": "Welt der Wunder" + }, + "BULI": { + "enameuhd": "Sky Sport Bundesliga UHD", + "servicehd": "", + "servicesd": "1:0:16:DF:4:85:C00000:0:0:0:", + "serviceuhd": "1:0:1F:228:10:85:C00000:0:0:0:", + "tname": "Sky Bundesliga", + "enamehd": "", + "enamesd": "Sky Sport Bundesliga" + }, + "CLASS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Classica", + "enamehd": "", + "enamesd": "" + }, + "NAUCH": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Nautical Channel", + "enamehd": "", + "enamesd": "" + }, + "SKYF1": { + "enameuhd": "", + "servicehd": "1:0:19:11:3:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "SKY Sport F1", + "enamehd": "Sky Sport F1 HD", + "enamesd": "" + }, + "CIN24": { + "enameuhd": "", + "servicehd": "1:0:19:87:B:85:C00000:0:0:0:", + "servicesd": "1:0:16:2B:6:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Cinema Premieren +24", + "enamehd": "Sky Cinema Premieren +24 HD", + "enamesd": "Sky Cinema Premieren +24" + }, + "HDDIS": { + "enameuhd": "", + "servicehd": "1:0:19:82:6:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Discovery HD", + "enamehd": "Discovery HD", + "enamesd": "" + }, + "BUTV": { + "enameuhd": "", + "servicehd": "1:0:19:85:3:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Beate-Uhse.TV", + "enamehd": "Beate Uhse HD", + "enamesd": "" + }, + "DMC": { + "enameuhd": "", + "servicehd": "1:0:19:157F:41F:1:C00000:0:0:0:", + "servicesd": "1:0:1:41:7:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "DELUXE MUSIC", + "enamehd": "Deluxe Music HD", + "enamesd": "DELUXE MUSIC" + }, + "DMF": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:313C:459:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Deutsches Musik Fernsehen", + "enamehd": "", + "enamesd": "Deutsches Musik Fernsehen" + }, + "PRO7": { + "enameuhd": "", + "servicehd": "1:0:19:EF75:3F9:1:C00000:0:0:0:", + "servicesd": "1:0:1:445D:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ProSieben", + "enamehd": "ProSieben HD", + "enamesd": "ProSieben" + }, + "CPLUSS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:2264:438:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Canal+ Sport", + "enamehd": "", + "enamesd": "CANAL+SPORT" + }, + "3SAT": { + "enameuhd": "", + "servicehd": "1:0:19:2B8E:3F2:1:C00000:0:0:0:", + "servicesd": "1:0:1:6D67:437:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "3sat", + "enamehd": "3sat HD", + "enamesd": "3sat" + }, + "SKY-NA": { + "enameuhd": "", + "servicehd": "1:0:19:F:2:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Nature", + "enamehd": "Sky Nature HD", + "enamesd": "" + }, + "PULS8": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "PULS acht", + "enamehd": "", + "enamesd": "" + }, + "PBOY": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:778B:424:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Playboy TV", + "enamehd": "", + "enamesd": "PLAYBOY TV" + }, + "SHOT": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Show Turk", + "enamehd": "", + "enamesd": "" + }, + "EURON": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:79FE:443:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "euronews", + "enamehd": "", + "enamesd": "EURONEWS GERMAN SD" + }, + "ZDF": { + "enameuhd": "", + "servicehd": "1:0:19:2B66:3F3:1:C00000:0:0:0:", + "servicesd": "1:0:1:6D66:437:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ZDF", + "enamehd": "ZDF HD", + "enamesd": "ZDF" + }, + "PULS4": { + "enameuhd": "", + "servicehd": "1:0:19:14B7:407:1:C00000:0:0:0:", + "servicesd": "1:0:1:4E27:43A:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "PULS 4", + "enamehd": "PULS 4 HD Austria", + "enamesd": "PULS 4 Austria" + }, + "LAUNE": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Gute Laune TV", + "enamehd": "", + "enamesd": "" + }, + "ROM": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:206:2:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Romance TV", + "enamehd": "", + "enamesd": "Romance TV" + }, + "FR24E": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:1AFA:3FE:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 24 (engl.)", + "enamehd": "", + "enamesd": "France 24 (In English)" + }, + "RTL": { + "enameuhd": "RTL UHD", + "servicehd": "1:0:19:EF10:421:1:C00000:0:0:0:", + "servicesd": "1:0:1:2EE3:441:1:C00000:0:0:0:", + "serviceuhd": "1:0:1F:307A:3F5:1:C00000:0:0:0:", + "tname": "RTL", + "enamehd": "RTL HD", + "enamesd": "RTL Television" + }, + "SNHD": { + "enameuhd": "", + "servicehd": "1:0:19:6C:C:85:C00000:0:0:0:", + "servicesd": "1:0:1:25:F:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Sport News", + "enamehd": "Sky Sport News HD", + "enamesd": "Sky Sport News" + }, + "QVC": { + "enameuhd": "QVC UHD", + "servicehd": "1:0:19:526F:41D:1:C00000:0:0:0:", + "servicesd": "1:0:1:702:5:85:C00000:0:0:0:", + "serviceuhd": "1:0:1F:1086:3EE:1:C00000:0:0:0:", + "tname": "QVC", + "enamehd": "QVC HD", + "enamesd": "QVC" + }, + "AMS": { + "enameuhd": "", + "servicehd": "1:0:19:22:F:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Auto Motor und Sport", + "enamehd": "AutoMotorSport HD temp", + "enamesd": "" + }, + "SPORT": { + "enameuhd": "", + "servicehd": "1:0:19:1581:41F:1:C00000:0:0:0:", + "servicesd": "1:0:1:384:21:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SPORT1", + "enamehd": "SPORT1 HD", + "enamesd": "SPORT1" + }, + "SERVU": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:3336:45B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ServusTV Deutschland", + "enamehd": "", + "enamesd": "ServusTV Deutschland" + }, + "123TV": { + "enameuhd": "", + "servicehd": "1:0:19:157E:41F:1:C00000:0:0:0:", + "servicesd": "1:0:1:296:5:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "123.tv", + "enamehd": "1-2-3.tv HD", + "enamesd": "1-2-3.tv" + }, + "BBC-E": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC Entertainment", + "enamehd": "", + "enamesd": "" + }, + "TNT-F": { + "enameuhd": "", + "servicehd": "1:0:19:8C:4:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Warner TV Film", + "enamehd": "Warner TV Film HD", + "enamesd": "" + }, + "DR2": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "DR2", + "enamehd": "", + "enamesd": "" + }, + "TNT-C": { + "enameuhd": "", + "servicehd": "1:0:19:88:B:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Warner TV Comedy", + "enamehd": "Warner TV Comedy HD", + "enamesd": "" + }, + "UNIVE": { + "enameuhd": "", + "servicehd": "1:0:19:65:9:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Universal Channel HD", + "enamehd": "Universal TV HD", + "enamesd": "" + }, + "BBC-N": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC News", + "enamehd": "", + "enamesd": "" + }, + "ZINFO": { + "enameuhd": "", + "servicehd": "1:0:19:2BA2:3F2:1:C00000:0:0:0:", + "servicesd": "1:0:1:6D6B:437:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ZDFinfo", + "enamehd": "ZDFinfo HD", + "enamesd": "ZDFinfo" + }, + "BLM": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:1C20:457:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Bloomberg Europe TV", + "enamehd": "", + "enamesd": "Bloomberg Europe TV" + }, + "BERG": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:1013:451:35:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Bergblick", + "enamehd": "", + "enamesd": "Bergblick" + }, + "SCIFI": { + "enameuhd": "", + "servicehd": "1:0:19:7E:C:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Syfy", + "enamehd": "SYFY HD", + "enamesd": "" + }, + "UHD1": { + "enameuhd": "UHD1 by ASTRA / HD+", + "servicehd": "", + "servicesd": "", + "serviceuhd": "1:0:1F:2:40B:1:C00000:0:0:0:", + "tname": "UHD1", + "enamehd": "", + "enamesd": "" + }, + "TNT-S": { + "enameuhd": "", + "servicehd": "1:0:19:7B:9:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Warner TV Serie", + "enamehd": "Warner TV Serie HD", + "enamesd": "" + }, + "SP-GE": { + "enameuhd": "", + "servicehd": "1:0:19:89:10:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "SPIEGEL Geschichte", + "enamehd": "Spiegel Geschichte HD", + "enamesd": "" + }, + "DWTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:114E:404:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "DW (Europe)", + "enamehd": "", + "enamesd": "DW English" + }, + "CH21": { + "enameuhd": "", + "servicehd": "1:0:19:2778:409:1:C00000:0:0:0:", + "servicesd": "1:0:1:301:7:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Channel21", + "enamehd": "Channel21 HD", + "enamesd": "Channel21" + }, + "PRO7F": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "ProSieben Fun", + "enamehd": "", + "enamesd": "" + }, + "PRO7M": { + "enameuhd": "", + "servicehd": "1:0:19:EF78:3F9:1:C00000:0:0:0:", + "servicesd": "1:0:1:4461:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ProSieben MAXX", + "enamehd": "Pro7 MAXX HD", + "enamesd": "Pro7 MAXX" + }, + "VOXUP": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:7094:443:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "VOXup", + "enamehd": "", + "enamesd": "VOXup" + }, + "SERVUSA": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Servus TV \u00d6sterreich", + "enamehd": "", + "enamesd": "" + }, + "ORFSP": { + "enameuhd": "", + "servicehd": "1:0:19:33FD:3ED:1:C00000:0:0:0:", + "servicesd": "1:0:1:33A5:3EB:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ORF SPORT +", + "enamehd": "ORF SPORT+ HD", + "enamesd": "ORF SPORT+" + }, + "SKYSPL": { + "enameuhd": "", + "servicehd": "1:0:19:91:9:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Sport Premier League", + "enamehd": "Sky Sport Premier League HD", + "enamesd": "" + }, + "ANIXE": { + "enameuhd": "", + "servicehd": "1:0:19:526C:41D:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "ANIXE", + "enamehd": "ANIXE HD", + "enamesd": "" + }, + "C-NET": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:194:B:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Cartoon Network", + "enamehd": "", + "enamesd": "Cartoon Network" + }, + "N-GHD": { + "enameuhd": "", + "servicehd": "1:0:19:70:D:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "National Geographic HD", + "enamehd": "NatGeo HD", + "enamesd": "" + }, + "VOX": { + "enameuhd": "", + "servicehd": "1:0:19:EF11:421:1:C00000:0:0:0:", + "servicesd": "1:0:1:2F1C:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "VOX", + "enamehd": "VOX HD", + "enamesd": "VOX" + }, + "RMTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:3146:459:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "rheinmain tv", + "enamehd": "", + "enamesd": "rhein main tv" + }, + "HH1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Hamburg 1", + "enamehd": "", + "enamesd": "" + }, + "SKYAT": { + "enameuhd": "", + "servicehd": "1:0:19:6E:D:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Atlantic HD", + "enamehd": "Sky Atlantic HD", + "enamesd": "" + }, + "SKY-CO": { + "enameuhd": "", + "servicehd": "1:0:19:E:2:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Comedy", + "enamehd": "Sky Comedy HD", + "enamesd": "" + }, + "HEIMA": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:16:2:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Heimatkanal", + "enamehd": "", + "enamesd": "Heimatkanal" + }, + "CNBC": { + "enameuhd": "", + "servicehd": "1:0:19:7D:9:85:C00000:0:0:0:", + "servicesd": "1:0:1:272E:402:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "CNBC", + "enamehd": "CNBC HD", + "enamesd": "CNBC Europe" + }, + "ORF1": { + "enameuhd": "", + "servicehd": "1:0:19:132F:3EF:1:C00000:0:0:0:", + "servicesd": "1:0:1:32C9:45D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ORF eins", + "enamehd": "ORF1 HD", + "enamesd": "ORF1" + }, + "CPLUS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:2261:438:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Canal+", + "enamehd": "", + "enamesd": "CANAL+" + }, + "ORF3": { + "enameuhd": "", + "servicehd": "1:0:19:33FC:3ED:1:C00000:0:0:0:", + "servicesd": "1:0:1:332D:45B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ORF III", + "enamehd": "ORF III HD", + "enamesd": "ORF III" + }, + "ORF2": { + "enameuhd": "", + "servicehd": "1:0:19:33F7:3ED:1:C00000:0:0:0:", + "servicesd": "1:0:1:32CA:45D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ORF 2", + "enamehd": "ORF2B HD", + "enamesd": "ORF2" + }, + "RBTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Rocket Beans TV", + "enamehd": "", + "enamesd": "" + }, + "TRACE": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:24C6:43C:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Trace TV", + "enamehd": "", + "enamesd": "TRACE URBAN" + }, + "DISNE": { + "enameuhd": "", + "servicehd": "1:0:19:157C:41F:1:C00000:0:0:0:", + "servicesd": "1:0:1:701:5:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Disney Channel", + "enamehd": "Disney Channel HD", + "enamesd": "Disney Channel" + }, + "ATV": { + "enameuhd": "", + "servicehd": "1:0:19:33AC:3EB:1:C00000:0:0:0:", + "servicesd": "1:0:1:32D4:45D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ATV", + "enamehd": "ATV HD", + "enamesd": "ATV" + }, + "K1": { + "enameuhd": "", + "servicehd": "1:0:19:EF76:3F9:1:C00000:0:0:0:", + "servicesd": "1:0:1:445E:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "kabel eins", + "enamehd": "kabel eins HD", + "enamesd": "kabel eins" + }, + "KINOW": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:196:2:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "KinoweltTV", + "enamehd": "", + "enamesd": "Kinowelt TV" + }, + "SPO-A": { + "enameuhd": "", + "servicehd": "1:0:19:8F:9:85:C00000:0:0:0:", + "servicesd": "1:0:16:1E:2:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Sport Austria", + "enamehd": "11170H SID 0x8f", + "enamesd": "Sky Sport Austria 1" + }, + "SKY-CR": { + "enameuhd": "", + "servicehd": "1:0:19:D:6:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Crime", + "enamehd": "Sky Crime HD", + "enamesd": "" + }, + "NOWUS": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "NOW US", + "enamehd": "", + "enamesd": "" + }, + "GOLD": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "GoldStar TV", + "enamehd": "", + "enamesd": "" + }, + "SKYRP": { + "enameuhd": "", + "servicehd": "1:0:19:7C:C:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "sky replay", + "enamehd": "Sky Replay HD", + "enamesd": "" + }, + "TOGGO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:2EFE:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "TOGGO plus", + "enamehd": "", + "enamesd": "TOGGO plus" + }, + "TVM": { + "enameuhd": "", + "servicehd": "1:0:19:16A9:3FF:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "m\u00fcnchen.tv", + "enamehd": "m\u00fcnchen.tv HD", + "enamesd": "" + }, + "HR": { + "enameuhd": "", + "servicehd": "1:0:19:2873:425:1:C00000:0:0:0:", + "servicesd": "1:0:1:6DCC:44D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "HR", + "enamehd": "hr-fernsehen HD", + "enamesd": "hr-fernsehen" + }, + "ARTE": { + "enameuhd": "", + "servicehd": "1:0:19:283E:3FB:1:C00000:0:0:0:", + "servicesd": "1:0:1:7034:41B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ARTE", + "enamehd": "arte HD", + "enamesd": "arte" + }, + "SKYSTE": { + "enameuhd": "", + "servicehd": "1:0:19:81:6:85:C00000:0:0:0:", + "servicesd": "1:0:16:DD:4:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Sport Top Event", + "enamehd": "Sky Sport Top Event HD", + "enamesd": "Sky Sport Top Event" + }, + "MDR": { + "enameuhd": "", + "servicehd": "1:0:19:2870:425:1:C00000:0:0:0:", + "servicesd": "1:0:1:6E44:431:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "MDR", + "enamehd": "MDR Sachsen HD", + "enamesd": "MDR Sachsen" + }, + "C5": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Canale 5", + "enamehd": "", + "enamesd": "" + }, + "TVB": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "tv.berlin", + "enamehd": "", + "enamesd": "" + }, + "MEZZO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:1F4A:42E:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Mezzo", + "enamehd": "", + "enamesd": "MEZZO" + }, + "MTV-D": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:6FEF:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Club MTV", + "enamehd": "", + "enamesd": "MTV Dance" + }, + "SPTVW": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:31:D:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Curiosity Channel", + "enamehd": "", + "enamesd": "Curiosity Channel powered by Spiegel" + }, + "MTV-B": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "MTV Base", + "enamehd": "", + "enamesd": "" + }, + "CC": { + "enameuhd": "", + "servicehd": "1:0:19:5273:41D:1:C00000:0:0:0:", + "servicesd": "1:0:1:7004:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "COMEDY CENTRAL", + "enamehd": "ShopLC HD", + "enamesd": "Comedy Central" + }, + "MTV-L": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "MTV Live HD", + "enamehd": "", + "enamesd": "" + }, + "BBC": { + "enameuhd": "", + "servicehd": "1:0:1:1389:3EA:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC World News", + "enamehd": "BBC World News Europe HD", + "enamesd": "" + }, + "MTV-H": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:6FEE:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "MTV Hits", + "enamehd": "", + "enamesd": "MTV Hits" + }, + "NICKT": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:1B:D:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Nicktoons", + "enamehd": "", + "enamesd": "Nicktoons" + }, + "CIN": { + "enameuhd": "", + "servicehd": "1:0:19:83:6:85:C00000:0:0:0:", + "servicesd": "1:0:16:A:4:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Cinema Premieren", + "enamehd": "Sky Cinema Premieren HD", + "enamesd": "Sky Cinema Premieren" + }, + "TLC": { + "enameuhd": "", + "servicehd": "1:0:19:2774:409:1:C00000:0:0:0:", + "servicesd": "1:0:1:304:5:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "TLC", + "enamehd": "TLC HD", + "enamesd": "TLC" + }, + "EX-SP": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "EXTREME SPORTS", + "enamehd": "", + "enamesd": "" + }, + "FES": { + "enameuhd": "", + "servicehd": "1:0:19:2888:40F:1:C00000:0:0:0:", + "servicesd": "1:0:1:7032:41B:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ONE", + "enamehd": "ONE HD", + "enamesd": "ONE" + }, + "SKY1": { + "enameuhd": "", + "servicehd": "1:0:19:93:2:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky 1", + "enamehd": "Sky One HD", + "enamesd": "" + }, + "N3": { + "enameuhd": "", + "servicehd": "1:0:19:2859:401:1:C00000:0:0:0:", + "servicesd": "1:0:1:6E41:431:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "NDR", + "enamehd": "NDR FS HH HD", + "enamesd": "NDR FS HH" + }, + "SKYCS": { + "enameuhd": "", + "servicehd": "1:0:19:6F:D:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Cinema Special HD", + "enamehd": "Sky Cinema 007 HD", + "enamesd": "" + }, + "EURO": { + "enameuhd": "", + "servicehd": "1:0:19:30D6:413:1:C00000:0:0:0:", + "servicesd": "1:0:1:79E0:443:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Eurosport 1", + "enamehd": "Eurosport 1 HD", + "enamesd": "Eurosport 1 Deutschland" + }, + "BILD": { + "enameuhd": "", + "servicehd": "1:0:19:2775:409:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Bild TV", + "enamehd": "BILD HD", + "enamesd": "" + }, + "EURO2": { + "enameuhd": "", + "servicehd": "1:0:19:6D:B:85:C00000:0:0:0:", + "servicesd": "1:0:16:100A:451:35:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Eurosport 2", + "enamehd": "Eurosport 2 HD", + "enamesd": "Elevensports 1 FR" + }, + "FFTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "FIX & FOXI", + "enamehd": "", + "enamesd": "" + }, + "SKYST": { + "enameuhd": "", + "servicehd": "1:0:19:72:D:85:C00000:0:0:0:", + "servicesd": "1:0:16:DE:2:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Sport Tennis", + "enamehd": "Sky Sport Tennis HD", + "enamesd": "Sky Sport Tennis" + }, + "2NEO": { + "enameuhd": "", + "servicehd": "1:0:19:2B7A:3F3:1:C00000:0:0:0:", + "servicesd": "1:0:1:6D6E:437:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ZDFneo", + "enamehd": "zdf_neo HD", + "enamesd": "zdf_neo" + }, + "LEITV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Leipzig Fernsehen", + "enamehd": "", + "enamesd": "" + }, + "EOTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "More than Sports TV", + "enamehd": "", + "enamesd": "" + }, + "NTV": { + "enameuhd": "", + "servicehd": "1:0:19:EF14:421:1:C00000:0:0:0:", + "servicesd": "1:0:1:2F3A:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "n-tv", + "enamehd": "ntv HD", + "enamesd": "ntv" + }, + "SKYSM": { + "enameuhd": "", + "servicehd": "1:0:19:8D:9:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Sport Mix", + "enamehd": "Sky Sport Mix HD", + "enamesd": "" + }, + "SKYSH": { + "enameuhd": "", + "servicehd": "1:0:19:8E:B:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "sky showcase", + "enamehd": "Sky Showcase HD", + "enamesd": "" + }, + "SKYSG": { + "enameuhd": "", + "servicehd": "1:0:19:90:D:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Sport Golf", + "enamehd": "Sky Sport Golf HD", + "enamesd": "" + }, + "K1CLA": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:14C2:407:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "kabel eins CLASSICS", + "enamehd": "", + "enamesd": "kabel eins classics" + }, + "CPLUSC": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:2263:438:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Canal+ Cin\u00e9ma", + "enamehd": "", + "enamesd": "CANAL+CINEMA" + }, + "SAT1": { + "enameuhd": "", + "servicehd": "1:0:19:EF74:3F9:1:C00000:0:0:0:", + "servicesd": "1:0:1:445C:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SAT.1", + "enamehd": "SAT.1 HD", + "enamesd": "SAT.1" + }, + "CRIN": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:192:B:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Crime + Investigation", + "enamehd": "", + "enamesd": "12382H SID 0x192" + }, + "SKY-F": { + "enameuhd": "", + "servicehd": "1:0:19:8B:2:85:C00000:0:0:0:", + "servicesd": "1:0:16:197:4:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Family", + "enamehd": "Sky Cinema Family HD", + "enamesd": "Sky Cinema Family" + }, + "SKY-A": { + "enameuhd": "", + "servicehd": "1:0:19:74:9:85:C00000:0:0:0:", + "servicesd": "1:0:16:9:3:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Action", + "enamehd": "Sky Cinema Action HD", + "enamesd": "Sky Cinema Action" + }, + "SKY-C": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:8:3:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Sky Cinema Fun", + "enamehd": "", + "enamesd": "Sky Cinema Fun HD" + }, + "MOVTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:A8:B:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Motorvision TV", + "enamehd": "", + "enamesd": "Motorvision TV" + }, + "SKY-N": { + "servicesd": "1:0:16:204:6:85:C00000:0:0:0:", + "enameuhd": "", + "searchtyp": "service", + "servicehd": "", + "enamehd": "", + "serviceuhd": "", + "tname": "Sky Cinema Classics", + "enamesd": "Sky Cinema Classics HD" + }, + "SAT1G": { + "enameuhd": "", + "servicehd": "1:0:19:30D4:413:1:C00000:0:0:0:", + "servicesd": "1:0:1:4460:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SAT.1 Gold", + "enamehd": "SAT.1 Gold HD", + "enamesd": "SAT.1 Gold" + }, + "SKY-K": { + "enameuhd": "", + "servicehd": "1:0:19:17:4:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Krimi", + "enamehd": "Sky Krimi HD", + "enamesd": "" + }, + "SAT1E": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:16:14C1:407:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SAT.1 emotions", + "enamehd": "", + "enamesd": "SAT.1 emotions" + }, + "SKY-D": { + "enameuhd": "", + "servicehd": "1:0:19:10:3:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Documentaries", + "enamehd": "Sky Documentaries HD", + "enamesd": "" + }, + "ALJAZ": { + "enameuhd": "", + "servicehd": "1:0:19:13A7:3EA:1:C00000:0:0:0:", + "servicesd": "1:0:1:1158:404:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Al Jazeera", + "enamehd": "Al Jazeera English HD", + "enamesd": "Al Jazeera English" + }, + "BBC1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC One", + "enamehd": "", + "enamesd": "" + }, + "SPO-D": { + "enameuhd": "", + "servicehd": "1:0:19:1194:406:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "sportdigital Fussball", + "enamehd": "SPORTDIGITAL FUSSBALL HD_alt", + "enamesd": "" + }, + "SWR": { + "enameuhd": "", + "servicehd": "1:0:19:283F:3FB:1:C00000:0:0:0:", + "servicesd": "1:0:1:6DD1:44D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SWR/SR", + "enamehd": "SWR BW HD", + "enamesd": "SWR Fernsehen BW" + }, + "BBC4": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC Four", + "enamehd": "", + "enamesd": "" + }, + "EURO-S": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Euro Star", + "enamehd": "", + "enamesd": "" + }, + "BBC2": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "BBC Two", + "enamehd": "", + "enamesd": "" + }, + "N-GW": { + "enameuhd": "", + "servicehd": "1:0:19:76:6:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "NAT GEO WILD", + "enamehd": "Nat Geo Wild HD", + "enamesd": "" + }, + "SKYTH": { + "enameuhd": "", + "servicehd": "1:0:19:B:4:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "Sky Cinema Thriller HD", + "enamehd": "Sky Cinema Thriller HD", + "enamesd": "" + }, + "FATV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Fashion TV", + "enamehd": "", + "enamesd": "" + }, + "OE24TV": { + "enameuhd": "", + "servicehd": "1:0:19:3402:3ED:1:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "oe24.TV", + "enamehd": "oe24.TV HD", + "enamesd": "" + }, + "TV5": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:26B6:43E:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "TV5 Monde", + "enamehd": "", + "enamesd": "TV5 MONDE" + }, + "RNF": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Rhein-Neckar Fernsehen", + "enamehd": "", + "enamesd": "" + }, + "WELT": { + "enameuhd": "", + "servicehd": "1:0:19:5274:41D:1:C00000:0:0:0:", + "servicesd": "1:0:1:445F:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "WELT", + "enamehd": "WELT HD", + "enamesd": "WELT" + }, + "EURO-D": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Euro D", + "enamehd": "", + "enamesd": "" + }, + "HISHD": { + "enameuhd": "", + "servicehd": "1:0:19:71:B:85:C00000:0:0:0:", + "servicesd": "", + "serviceuhd": "", + "tname": "HISTORY HD", + "enamehd": "HISTORY Channel HD", + "enamesd": "" + }, + "SKLAR": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:20:21:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "sonnenklar TV", + "enamehd": "", + "enamesd": "Sonnenklar TV" + }, + "MAPO": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Marco Polo TV", + "enamehd": "", + "enamesd": "" + }, + "S1PLU": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:10CD:418:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SPORT1+", + "enamehd": "", + "enamesd": "SPORT1+" + }, + "DAZN": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "DAZN", + "enamehd": "", + "enamesd": "" + }, + "K1DOKU": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:4465:453:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "kabel eins Doku", + "enamehd": "", + "enamesd": "kabel eins Doku" + }, + "SILVE": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Silverline", + "enamehd": "", + "enamesd": "" + }, + "HGTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:26:F:85:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Home & Garden TV", + "enamehd": "", + "enamesd": "HGTV" + }, + "KTV": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:3139:459:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "K-TV", + "enamehd": "", + "enamesd": "K-TV" + }, + "MTV": { + "enameuhd": "", + "servicehd": "1:0:19:2777:409:1:C00000:0:0:0:", + "servicesd": "1:0:1:7006:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "MTV", + "enamehd": "MTV HD", + "enamesd": "MTV" + }, + "ATV2": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:33A7:3EB:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ATV II", + "enamehd": "", + "enamesd": "ATV2" + }, + "BIBEL": { + "enameuhd": "", + "servicehd": "1:0:19:33A8:3EB:1:C00000:0:0:0:", + "servicesd": "1:0:1:2F5A:454:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Bibel TV", + "enamehd": "Bibel TV HD", + "enamesd": "Bibel TV" + }, + "CNN": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:1146:404:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "CNN International", + "enamehd": "", + "enamesd": "CNN Int." + }, + "TV2": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "TV2", + "enamehd": "", + "enamesd": "" + }, + "RBB": { + "enameuhd": "", + "servicehd": "1:0:19:286F:425:1:C00000:0:0:0:", + "servicesd": "1:0:1:6E2E:431:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "RBB", + "enamehd": "rbb Berlin HD", + "enamesd": "rbb Berlin" + }, + "FR24F": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:1AF9:3FE:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "France 24 (franz.)", + "enamehd": "", + "enamesd": "France 24 (en Francais)" + }, + "QVCP": { + "enameuhd": "QVC ZWEI UHD", + "servicehd": "1:0:19:1580:41F:1:C00000:0:0:0:", + "servicesd": "1:0:1:D42:454:1:C00000:0:0:0:", + "serviceuhd": "1:0:1F:7DA:449:1:C00000:0:0:0:", + "tname": "QVC2", + "enamehd": "QVC ZWEI HD", + "enamesd": "QVC2" + }, + "NICKJ": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:6FFB:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Nick Jr.", + "enamehd": "", + "enamesd": "Nick.Jr." + }, + "BE1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Belgien 1", + "enamehd": "", + "enamesd": "" + }, + "ES1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:19:10CE:418:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "eSports1", + "enamehd": "", + "enamesd": "eSPORTS1" + }, + "TMAX": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Turkmax Gurme", + "enamehd": "", + "enamesd": "" + }, + "VH1": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:6FF1:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "VH1 Classic", + "enamehd": "", + "enamesd": "MTV 80s" + }, + "HEALTH": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:3138:459:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Health TV", + "enamehd": "", + "enamesd": "health.tv" + }, + "RTL-L": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "RTL Living", + "enamehd": "", + "enamesd": "" + }, + "NICK": { + "enameuhd": "", + "servicehd": "", + "servicesd": "1:0:1:7008:436:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "nick/MTV+", + "enamehd": "", + "enamesd": "Nick/Comedy Central+1" + }, + "RTL-N": { + "enameuhd": "", + "servicehd": "1:0:19:2EAF:411:1:C00000:0:0:0:", + "servicesd": "1:0:1:2F1D:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "NITRO", + "enamehd": "NITRO HD", + "enamesd": "NITRO" + }, + "ARD": { + "enameuhd": "", + "servicehd": "1:0:19:283D:3FB:1:C00000:0:0:0:", + "servicesd": "1:0:1:6DCA:44D:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "Das Erste", + "enamehd": "Das Erste HD", + "enamesd": "Das Erste" + }, + "ADULT": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "Adult Channel", + "enamehd": "", + "enamesd": "" + }, + "LUSTP": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "LUST PUR", + "enamehd": "", + "enamesd": "" + }, + "ALPHA": { + "enameuhd": "", + "servicehd": "1:0:19:2889:40F:1:C00000:0:0:0:", + "servicesd": "1:0:1:6F47:445:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "ARD-alpha", + "enamehd": "ARD alpha HD", + "enamesd": "ARD-alpha bis 14.12.2021 zu HD wechseln" + }, + "SUPER": { + "enameuhd": "", + "servicehd": "1:0:19:2E9B:411:1:C00000:0:0:0:", + "servicesd": "1:0:1:2F08:441:1:C00000:0:0:0:", + "serviceuhd": "", + "tname": "SUPER RTL", + "enamehd": "SUPER RTL HD", + "enamesd": "SUPER RTL" + }, + "RTL-C": { + "enameuhd": "", + "servicehd": "", + "servicesd": "", + "serviceuhd": "", + "tname": "RTL Crime", + "enamehd": "", + "enamesd": "" + } +} \ No newline at end of file diff --git a/src/tvspielfilmtvprogramm.py b/src/tvspielfilmtvprogramm.py deleted file mode 100755 index 1b8288c..0000000 --- a/src/tvspielfilmtvprogramm.py +++ /dev/null @@ -1,629 +0,0 @@ -# coding=utf-8 - -import re -from os import remove as os_remove -from time import strftime, localtime, time as nowtime -from datetime import datetime -from twisted.internet.defer import DeferredSemaphore -from enigma import gPixmapPtr -from Screens.Screen import Screen -from Screens.MessageBox import MessageBox -from Components.ActionMap import ActionMap -from Components.Label import Label -from Components.Pixmap import Pixmap -from Components.Sources.StaticText import StaticText -from Tools.Directories import pathExists -from Tools.LoadPixmap import LoadPixmap -from .Downloader import _headers_jpeg, headers_gzip, MygetPage, MydownloadPage, http_failed -from .tools import Load_My_Pixmap, Piconchannelname, listmainindex as mindex, mastxval_list -from .tvconfig import read_ServiceReference -from ._tvdict import _channelreference, _pixmap_cache, _tvresulu, _tvmastres, listprogindex, listprogresindex -from .ConfigInit import plugindir -from .MultiListSummary import MultiListSummary -from .MYSimpleSummary import MYSimpleSummary -from .TvSpielfilmView import TvSpielfilmView -from .EasyMenu import EasyMenu -from .MultiList import MultiList -from .MYList import MYList -from .__init__ import _ -from .Debug import logger - - -class TvSpielfilmChannelGroup(Screen): - - def __init__(self, session): - logger.info("...") - self.skinName = "TvSpielfilmChannelGroup" - Screen.__init__(self, session) - self["actions"] = ActionMap( - ["TVS_Actions"], - { - "ok": self.key_ok, - "cancel": self.close - } - ) - - self["liste"] = MYList() - - self.onLayoutFinish.append(self.finish) - # reslist = [] - if 'grouplist' not in _tvmastres: - _tvmastres['grouplist'] = [] - for val in _tvmastres['channelgroup']: - val_len = len(val) - 1 - tmplist = [] - for entys in range(6): - if entys == 0: - tmplist.append(val[entys][1]) - if entys <= val_len: - tmplist.append(_tvmastres['channelliste'].get(val[entys][2].upper())) - tmplist.append(Piconchannelname(val[entys][2].upper())) - else: - tmplist.extend(['', None]) - _tvmastres['grouplist'].append(tmplist) - _tvmastres['channelliste'].clear() - del _tvmastres['channelgroup'][:] - self["liste"].setList(_tvmastres['grouplist']) - - def finish(self): - logger.info("...") - self["liste"].setIndex(int(_tvresulu.get('cur_page', '1')) - 1) - - def key_ok(self): - logger.info("...") - curr = self["liste"].getCurrent() - if curr and curr[0]: - self.close(curr[0]) - - def createSummary(self): - logger.info("...") - return MYSimpleSummary - - -class TvSpielfilmTvProgramm(Screen, EasyMenu): - def __init__(self, session, programmtyp='tv-sender'): - logger.info("...") - self.skinName = "TvSpielfilmTvProgramm" - Screen.__init__(self, session) - EasyMenu.__init__(self, self) - - self["actions"] = ActionMap( - ["TVS_Actions", "NumberActions"], - { - "ok": self.key_ok, - "cancel": self.close, - "up": self.moveUp, - "down": self.moveDown, - "left": self.left, - "right": self.right, - "next": self.key_next, - "back": self.key_back, - "red": self.key_red, - "green": self.key_green, - "yellow": self.key_yellow, - "blue": self.key_blue, - "menu": self.showMenu, - "channelup": self.channelup, - "channeldown": self.channeldown, - "0": self.key_easymenu, - } - ) - - self.programmtyp = programmtyp - self.listvalue = ['liste0', 'liste1', 'liste2', 'liste3', 'liste4', 'liste5'] - self.listindex = 0 - self.listleng = len(self.listvalue) - self.mlist = [] - self["liste"] = MultiListSummary(mastxval_list[:]) # lcd - self["searchdate"] = Label() - _tvresulu['cur_page'] = '1' - _tvmastres.clear() - - for listint in range(len(self.listvalue)): - self.mlist.append([]) - listeval = "liste%d" % listint - self[listeval] = MultiList(None, "TvSpielfilmTvProgramm", "screenpart_programm_template.tpl") - channval = "channel%d" % listint - self[channval] = Label() - channpix = "channelpix%d" % listint - self[channpix] = Pixmap() - programmpix = "programmpix%d" % listint - self[programmpix] = Pixmap() - timeval = "time%d" % listint - self[timeval] = Label() - descriptionval = "description%d" % listint - self[descriptionval] = Label() - self[descriptionval].hide() - - self.mytimecount = 1 - mytime = int(nowtime()) - self["searchdate"].text = strftime("< %A, %d. %b %y >", localtime(mytime)) - self.date_string = strftime("&date=%Y-%m-%d") - mytime = mytime - 86400 - self.timelist = [] - for _tre in range(0, 15): - self.timelist.append([strftime("< %A, %d. %b %y >", localtime(mytime)), strftime("&date=%Y-%m-%d", localtime(mytime))]) - mytime = mytime + 86400 - - self["key_red"] = StaticText("TV Spielfilm Main") - self["key_green"] = StaticText("TV Tipps") - self["key_yellow"] = StaticText(_("Search")) - self["key_blue"] = StaticText(_("Reload")) - - self.download = DeferredSemaphore(tokens=6) - self.isdownload = False - self.onClose.append(self.__onClose__) - self.onLayoutFinish.append(self.key_blue) - self.firststart() - - def firststart(self): - logger.info("...") - if not _channelreference: - read_ServiceReference() - - def download_page(self): - logger.info("...") - self.isdownload = True - text = _('Loading...') + ' ' + _('Page') + ': ' + _tvresulu.get('cur_page', '1') - tmp = mastxval_list[:] - tmp[mindex['title']] = text - self["liste"].setList(tmp) - self.setTitle(text) - url = 'https://www.tvspielfilm.de/tv-programm/%s/?page=%s%s' % (self.programmtyp, _tvresulu.get('cur_page', '1'), self.date_string) - # horst = url.split('/')[2] - if self['description0'].getVisible(): - self.clear_values() - del self.download.waiting[:] - self.download.run(MygetPage, url, headers=headers_gzip).addCallback(self.result_back).addErrback(http_failed) - - def update_Title(self): - logger.info("...") - title = "Tv Spielfilm TV-Programm " + " - " + _("Page") + ": " + "%s/%s" % (_tvresulu.get('cur_page', '1'), _tvresulu.get('max_page', '34')) - self.setTitle(title) - - def createSummary(self): - logger.info("...") - self.skin_summary = "TvSpielfilmmain_group_summary" - return MYSimpleSummary - - def update_liste(self): - logger.info("...") - curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() - if curr: - rindex = listprogresindex - tmp = self["liste"].getCurrent() - tmp[mindex['channel']] = self.mlist[self.listindex][0] - tmp[mindex['time']] = curr[rindex['time']] - tmp[mindex['date']] = self.timelist[self.mytimecount][0] - tmp[mindex['title']] = curr[rindex['title']] - tmp[mindex['description']] = curr[rindex['subtitle']] - tmp[mindex['daumen']] = curr[rindex['daumen']] - tmp[mindex['channelpix']] = self.mlist[self.listindex][1] - tmp[mindex['tipp']] = curr[rindex['tipp']] - tmp[mindex['neu']] = curr[rindex['neu']] - if self.mlist[self.listindex][3]: - currindex = self[self.listvalue[self.listindex]].l.getCurrentSelectionIndex() - if currindex == self.mlist[self.listindex][4]: - tmp[mindex['preview']] = self.mlist[self.listindex][3] - else: - tmp[mindex['preview']] = None # self.mlist[self.listindex][3] - - self["liste"].setList(tmp) - - def clear_values(self): - logger.info("...") - for listint in range(len(self.listvalue)): - channval = "channel%d" % listint - timeval = "time%d" % listint - listeval = "liste%d" % listint - descriptionval = "description%d" % listint - channpix = "channelpix%d" % listint - propix = "programmpix%d" % listint - self[channval].setText('') - self[timeval].setText('') - self[descriptionval].setText('') - self[channpix].instance.setPixmap(gPixmapPtr()) - self[listeval].l.setList([]) - self[propix].instance.setPixmap(gPixmapPtr()) - - def set_values(self, val=None): - logger.info("...") - notres = _('None') + ' ' + _('Entries') + ' ' + _('found') - cindex = listprogindex - for listint in range(len(self.listvalue)): - channval = "channel%d" % listint - timeval = "time%d" % listint - listeval = "liste%d" % listint - descriptionval = "description%d" % listint - channpix = "channelpix%d" % listint - propix = "programmpix%d" % listint - if val: - if val[listint][cindex['channel']]: - self[channval].setText(val[listint][cindex['channel']]) - if val[listint][cindex['time']]: - self[timeval].setText(val[listint][cindex['time']]) - - if val[listint][cindex['title']]: - self[descriptionval].setText(val[listint][cindex['title']]) - if not self[descriptionval].getVisible(): - self[descriptionval].show() - - if val[listint][cindex['channelpix']]: - self[channpix].instance.setPixmap(val[listint][cindex['channelpix']]) - if val[listint][cindex['reslist']]: - self[listeval].l.setList(val[listint][cindex['reslist']]) - self.mlist[listint] = [val[listint][cindex['channel']], val[listint][cindex['channelpix']], val[listint][cindex['id']], None, val[listint][cindex['index']]] - else: - self[listeval].l.setList([['', '', notres, None, '', '', '']]) - self.mlist[listint] = ['', '', '', None, 0] - - if val[listint][cindex['index']]: - self[listeval].moveToIndex(val[listint][cindex['index']]) - - if isinstance(val[listint][cindex['programmpixurl']], gPixmapPtr): - self[propix].instance.setPixmap(val[listint][cindex['programmpixurl']]) - self.mlist[listint][3] = val[listint][cindex['programmpixurl']] - elif val[listint][cindex['programmpixurl']]: - url = val[listint][cindex['programmpixurl']] - file = '/tmp/programmpix%d%s' % (listint, url[-4:]) - self.download.run(MydownloadPage, url, file, headers=_headers_jpeg).addCallback(self.result_back_pix, listint, file).addErrback(http_failed) - else: - self[propix].instance.setPixmap(gPixmapPtr()) - else: - self[channval].setText('') - self[timeval].setText('') - self[descriptionval].setText('') - if self[descriptionval].getVisible(): - self[descriptionval].hide() - self[channpix].instance.setPixmap(gPixmapPtr()) - self.mlist[listint] = ['', '', '', None, 0] - self[listeval].l.setList([['', '', notres, None, '', '', '']]) - self[propix].instance.setPixmap(gPixmapPtr()) - self[self.listvalue[self.listindex]].setSelectionEnable(True) - self.update_Title() - self.update_liste() - - def result_back(self, result): - logger.info("...") - self.isdownload = False - if result: - val = tvsenderparser(result) - if val: - self.set_values(val) - else: - text = _('Nothing there!') - self.session.open(MessageBox, text, MessageBox.TYPE_INFO, timeout=10) - self.update_Title() - - def result_back_pix(self, _result, intval, file): - logger.info("...") - if pathExists(file): - ptr = LoadPixmap(file) - if ptr: - propix = "programmpix%d" % intval - self[propix].instance.setPixmap(ptr) - self.mlist[intval][3] = ptr - if self.listindex == intval: - tmp = self["liste"].getCurrent() - tmp[mindex['preview']] = ptr - tmp[mindex['description']] = '' - self["liste"].setList(tmp) - os_remove(file) - - def left(self): - logger.info("...") - if self.isdownload: - return - self[self.listvalue[self.listindex]].setSelectionEnable(False) - self.listindex -= 1 - if self.listindex < 0: - self.listindex = 0 - self.channeldown() - self.key_blue() - else: - self[self.listvalue[self.listindex]].setSelectionEnable(True) - self.update_liste() - - def right(self): - logger.info("...") - if self.isdownload: - return - self[self.listvalue[self.listindex]].setSelectionEnable(False) - self.listindex += 1 - if self.listindex >= len(self.listvalue): - self.listindex = 0 - self.channelup() - self.key_blue() - else: - self[self.listvalue[self.listindex]].setSelectionEnable(True) - self.update_liste() - - def moveUp(self): - logger.info("...") - self[self.listvalue[self.listindex]].moveUp() - self.update_liste() - - def moveDown(self): - logger.info("...") - self[self.listvalue[self.listindex]].moveDown() - self.update_liste() - - def showMenu(self): - logger.info("...") - self.session.openWithCallback(self.backval, TvSpielfilmChannelGroup) - - def key_easymenu(self): - logger.info("...") - self.openEasyMenu(self.session) - - def backval(self, val=None): - logger.info("...") - if val: - _tvresulu['cur_page'] = str(val) - self.key_blue() - - def channelup(self): - logger.info("...") - curr = int(_tvresulu.get('cur_page', '1')) - if curr >= int(_tvresulu.get('max_page', '34')): - curr = 1 - else: - curr += 1 - _tvresulu['cur_page'] = str(curr) - self.update_Title() - - def channeldown(self): - logger.info("...") - curr = int(_tvresulu.get('cur_page', '1')) - if curr <= 1: - curr = int(_tvresulu.get('max_page', '34')) - else: - curr -= 1 - _tvresulu['cur_page'] = str(curr) - self.update_Title() - - def key_next(self): - logger.info("...") - self.mytimecount += 1 - self.mytimecount = max(min(len(self.timelist) - 1, self.mytimecount), 0) - self.date_string = self.timelist[self.mytimecount][1] - self["searchdate"].text = self.timelist[self.mytimecount][0] - _tvresulu['cur_page'] = '1' - self.key_blue() - self.update_Title() - - def key_back(self): - logger.info("...") - self.mytimecount -= 1 - self.mytimecount = max(min(len(self.timelist) - 1, self.mytimecount), 0) - self.date_string = self.timelist[self.mytimecount][1] - self["searchdate"].text = self.timelist[self.mytimecount][0] - _tvresulu['cur_page'] = '1' - self.key_blue() - self.update_Title() - - def key_ok(self): - logger.info("...") - try: - curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() - rindex = listprogresindex - if curr and curr[rindex['channelurl']].startswith('http'): - resu = mastxval_list[:] - resu[mindex['channel']] = self.mlist[self.listindex][0] - resu[mindex['title']] = curr[rindex['title']] - resu[mindex['channelpix']] = self.mlist[self.listindex][1] - resu[mindex['id']] = self.mlist[self.listindex][2] - resu[mindex['urlsendung']] = curr[rindex['channelurl']] - resu[mindex['daumen']] = curr[rindex['daumen']] - resu[mindex['neu']] = curr[rindex['neu']] - resu[mindex['tipp']] = curr[rindex['tipp']] - try: - tring = self.date_string[6:] + '-' + curr[rindex['time']] - resu[mindex['datastart']] = int(datetime.strptime(tring, '%Y-%m-%d-%H:%M').strftime("%s")) - except Exception as _error: - # print error - pass - self.session.open(TvSpielfilmView, resu) - except Exception: - pass - - def key_red(self): - logger.info("...") - self.close("main") - - def key_green(self): - logger.info("...") - self.close("tipps") - - def key_yellow(self): - logger.info("...") - try: - curr = self[self.listvalue[self.listindex]].l.getCurrentSelection() - if curr and curr[1]: - self.close("search", curr[1]) - except Exception: - pass - - def key_search(self): - self.key_yellow() - - def key_blue(self): - logger.info("...") - if not self.isdownload: - self.download_page() - - def __onClose__(self): - logger.info("...") - del self.download.waiting[:] - del self.download - if _pixmap_cache: - _pixmap_cache.clear() - if _tvresulu: - _tvresulu.clear() - if _tvmastres: - if 'grouplist' in _tvmastres: - del _tvmastres['grouplist'][:] - _tvmastres.clear() - - -class TvSpielfilmTvProgrammsky(TvSpielfilmTvProgramm): - def __init__(self, session): - logger.info("...") - TvSpielfilmTvProgramm.__init__(self, session, 'sky') - self.skinName = "TvSpielfilmTvProgramm" - - -listprog = [''] * listprogindex['listend'] -listprog[listprogindex['channelpix']] = None -listprog[listprogindex['index']] = 0 -listprog[listprogindex['reslist']] = [] - -listprogres = [''] * listprogresindex['listend'] -listprogres[listprogresindex['daumen']] = None - - -def tvsenderparser(masresult): - def clean(res): - logger.info("...") - return res.replace(' ', ' ').replace('&', '&').replace('', '').strip() - - logger.info("...") - if 'channelgroup' not in _tvmastres: - channelgroup = re.compile(r'
.+?
.+?', re.S) - channelgroup_val = re.search(channelgroup, masresult) - channelgroup_group = re.compile(r'
  • .+?
  • ', re.S) - channelgroup_group_res = re.findall(channelgroup_group, channelgroup_val.group()) - channelgroup_list = re.compile(r'', re.S) - _tvmastres['channelgroup'] = [] - for entys, _item in enumerate(channelgroup_group_res): - _tvmastres['channelgroup'].append(re.findall(channelgroup_list, channelgroup_group_res[entys])) - channelall = re.compile(r'.+?', re.S) - channelall_val = re.search(channelall, masresult) - _tvmastres['channelliste'] = {} - if channelall_val: - channelres = re.compile(r'', re.S) - channelres_val = re.findall(channelres, channelall_val.group()) - if channelres_val: - _tvmastres['channelliste'] = dict(re.findall(channelres, channelall_val.group())) - programmholder = re.compile(r'
    .+?
    ', re.S) - programmholder_val = re.search(programmholder, masresult) - del masresult - if not programmholder_val: - return False - logo_scroller = re.compile(r'id="logo-scroller">.+?
    ', re.S) - logo_scroller_val = re.search(logo_scroller, programmholder_val.group()) - - program_box = re.compile(r'
    .+?
    ', re.S) - program_box_val = re.search(program_box, programmholder_val.group()) - if not program_box_val: - return False - - program_box_ent = re.compile(r'
    .+?
    .+?
    ', re.S) - program_box_ent_res = re.findall(program_box_ent, program_box_val.group()) - prev_page = re.compile(r'formpage=(.+?)\'.+?class="btn-prev jqscroll', re.S) - prev_page_val = re.search(prev_page, programmholder_val.group()) - next_page = re.compile(r'class="btn-prev jqscroll.+?formpage=(.+?)\'.+?class="btn-next jqscroll', re.S) - next_page_val = re.search(next_page, programmholder_val.group()) - _tvresulu['next_page'] = next_page_val.group(1) - _tvresulu['prev_page'] = prev_page_val.group(1) - if 'max_page' not in _tvresulu: - _tvresulu['max_page'] = prev_page_val.group(1) - heading = re.compile(r'
    .+?
    .+?
    ', re.S) - heading_val = re.findall(heading, logo_scroller_val.group()) - heading_channel = re.compile(r'

    (.+?)

    ', re.S) - heading_pix_url_img_src = re.compile(r'', re.S) - - heading_title = re.compile(r'(.+?)', re.S) - heading_time = re.compile(r'(.+?)', re.S) - heading_url = re.compile(r'
    ', re.S) - - channelliste = [] - channelcounter = {} - for c in range(6): - channelliste.append(listprog[:]) - channelcounter[c] = 0 - for res, _item in enumerate(heading_val): - tmplist = listprog[:] - channelcounter[res] = 0 - tmp = re.search(heading_channel, heading_val[res]) - if tmp: - tmplist[listprogindex['channel']] = clean(tmp.group(1)) - tmp = re.search(heading_id, heading_val[res]) - if tmp: - channelname = tmp.group(1).strip().upper() - tmplist[listprogindex['id']] = channelname - tmplist[listprogindex['channelpix']] = Piconchannelname(channelname) - tmp = re.search(heading_title, program_box_ent_res[res]) - if tmp: - tmplist[listprogindex['title']] = clean(tmp.group(1)) - tmp = re.search(heading_time, program_box_ent_res[res]) - if tmp: - tmplist[listprogindex['time']] = tmp.group(1) - tmp = re.search(heading_url, program_box_ent_res[res]) - if tmp: - tmplist[listprogindex['channelurl']] = tmp.group(1) - tmplist[listprogindex['title2']] = clean(tmp.group(2)[len(tmplist[listprogindex['title']]) + 1:]) - tmp = re.search(heading_pix_url_data_src, program_box_ent_res[res]) - if tmp: - tmplist[listprogindex['programmpixurl']] = tmp.group(1) - else: - tmp = re.search(heading_pix_url_img_src, program_box_ent_res[res]) - if tmp: - tmplist[listprogindex['programmpixurl']] = tmp.group(1) - - channelliste[res] = tmplist - - info_block = re.compile(r'
    .+?
    ', re.S) - info_block_val = re.search(info_block, programmholder_val.group()) - - program_block = re.compile(r"
  • (.*?)
  • ", re.S) - program_block_val = re.finditer(program_block, info_block_val.group()) - program_block_split = re.compile(r'
    (.*?)
    ', re.S) - - time = re.compile(r'(.+?)', re.S) - title = re.compile(r'(.+?)', re.S) - subtitle = re.compile(r'(.+?)', re.S) - acttheme = re.compile(r'(.+?)', re.S) - channelurl = re.compile(r'
    ', re.S) - tipp = re.compile(r'(.+?)', re.S) - neu = re.compile(r'(.+?)', re.S) - - for programx in program_block_val: - split_val = re.split(program_block_split, programx.group())[1:] - for entys, _item in enumerate(split_val): - colentys_val = re.findall(colentys, split_val[entys]) - for colval in colentys_val: - tmplist = listprogres[:] - tmp = re.search(time, colval) - if tmp: - if channelliste[entys][listprogindex['time']] == tmp.group(1): - channelliste[entys][listprogindex['index']] = channelcounter[entys] - channelcounter[entys] += 1 - tmplist[listprogresindex['time']] = tmp.group(1) - tmp = re.search(title, colval) - if tmp: - tmplist[listprogresindex['title']] = clean(tmp.group(1)) - tmp = re.search(subtitle, colval) - if tmp: - tmplist[listprogresindex['subtitle']] = clean(tmp.group(1)) - tmp = re.search(acttheme, colval) - if tmp: - tmplist[listprogresindex['subtitle']] = clean(tmp.group(1)) - tmp = re.search(daumen, colval) - if tmp: - tmplist[listprogresindex['daumen']] = Load_My_Pixmap('%sicons/%s.png' % (plugindir, tmp.group(1).strip())) - tmp = re.search(tipp, colval) - if tmp: - tmplist[listprogresindex['tipp']] = tmp.group(1).strip() - tmp = re.search(neu, colval) - if tmp: - tmplist[listprogresindex['neu']] = tmp.group(1).strip() - tmp = re.search(channelurl, colval) - if tmp: - tmplist[listprogresindex['channelurl']] = tmp.group(1) - channelliste[entys][listprogindex['reslist']].append(tmplist) - return channelliste