|
22 | 22 | import subprocess
|
23 | 23 | from subprocess import Popen
|
24 | 24 | from xbmcswift2 import Plugin
|
25 |
| -import StringIO |
| 25 | +import io |
26 | 26 | import os
|
27 | 27 | import re
|
28 | 28 | import requests
|
29 | 29 | import sys
|
30 | 30 | import json
|
31 |
| -import urllib2 |
| 31 | +import urllib.request, urllib.error, urllib.parse |
32 | 32 | import time
|
33 | 33 | import ast
|
34 | 34 | import zipfile
|
35 | 35 | import datetime
|
36 |
| -import urllib |
| 36 | +import urllib.request, urllib.parse, urllib.error |
37 | 37 | import picons
|
38 | 38 |
|
39 | 39 | plugin = Plugin()
|
@@ -228,7 +228,7 @@ def _ArchiveDirectory(parentDirectory):
|
228 | 228 | if os.path.islink(fullPath):
|
229 | 229 | zipInfo = zipfile.ZipInfo(archiveRoot)
|
230 | 230 | zipInfo.create_system = 3
|
231 |
| - zipInfo.external_attr = 2716663808L |
| 231 | + zipInfo.external_attr = 2716663808 |
232 | 232 | zipOut.writestr(zipInfo, os.readlink(fullPath))
|
233 | 233 | else:
|
234 | 234 | zipOut.write(fullPath, archiveRoot, zipfile.ZIP_DEFLATED)
|
@@ -551,9 +551,9 @@ def muxes_load(net_uuid_sel):
|
551 | 551 | except:
|
552 | 552 | for mux_f in muxes['entries']:
|
553 | 553 | muxes_frequency.append(mux_f['channel_number'])
|
554 |
| - muxes_full = zip(muxes_name, muxes_network,) |
| 554 | + muxes_full = list(zip(muxes_name, muxes_network,)) |
555 | 555 | muxes_list = ["%s %s" % x for x in muxes_full]
|
556 |
| - muxes_frequency, muxes_list, muxes_uuid = zip(*sorted(zip(muxes_frequency, muxes_list, muxes_uuid))) |
| 556 | + muxes_frequency, muxes_list, muxes_uuid = list(zip(*sorted(zip(muxes_frequency, muxes_list, muxes_uuid)))) |
557 | 557 | create_mux = "CREATE NEW MUX"
|
558 | 558 | muxes_list = list(muxes_list)
|
559 | 559 | muxes_list.insert(0,create_mux)
|
@@ -1178,7 +1178,7 @@ def ch_param_edit(ch_uuid_sel, ch_info_list, ch_enabled, ch_autoname, ch_name, c
|
1178 | 1178 | epg_list_text = [x['names'] for x in epg_grid_load['entries']]
|
1179 | 1179 | epg_list_id = [x['id'] for x in epg_grid_load['entries']]
|
1180 | 1180 | epg_list_uuid = [x['uuid'] for x in epg_grid_load['entries']]
|
1181 |
| - epg_list_full = zip(epg_list_text, epg_list_id) |
| 1181 | + epg_list_full = list(zip(epg_list_text, epg_list_id)) |
1182 | 1182 | epg_list_list = ["%s - %s" % x for x in epg_list_full]
|
1183 | 1183 | sel_epg = dialog.select('Select EPG source for channel: ' + str(ch_number) + " " + str(ch_name), list=epg_list_list)
|
1184 | 1184 | if sel_epg < 0:
|
@@ -1223,13 +1223,13 @@ def cron_edit(epg_intcron):
|
1223 | 1223 | if cron_edit_sel:
|
1224 | 1224 | cron_sel_weekday = dialog.select('Select which day(s) to run the grabber', list=cron_def_weekday_list)
|
1225 | 1225 | if cron_sel_weekday >= 0:
|
1226 |
| - cron_new_weekday = cron_def_weekday.keys()[cron_def_weekday.values().index(cron_def_weekday_list[cron_sel_weekday])] |
| 1226 | + cron_new_weekday = list(cron_def_weekday.keys())[list(cron_def_weekday.values()).index(cron_def_weekday_list[cron_sel_weekday])] |
1227 | 1227 | cron_sel_hour = dialog.select('Select which hour(s) to run the grabber', list=cron_def_split_hour_list)
|
1228 | 1228 | if cron_sel_hour == 0:
|
1229 | 1229 | cron_sel_hour_spec = dialog.select('Select which hour(s) to run the grabber', list=cron_def_hours)
|
1230 | 1230 | cron_new_hour = cron_sel_hour_spec
|
1231 | 1231 | if cron_sel_hour > 0:
|
1232 |
| - cron_new_hour = cron_def_split_hour.keys()[cron_def_split_hour.values().index(cron_def_split_hour_list[cron_sel_hour])] |
| 1232 | + cron_new_hour = list(cron_def_split_hour.keys())[list(cron_def_split_hour.values()).index(cron_def_split_hour_list[cron_sel_hour])] |
1233 | 1233 | cron_new_min = dialog.input('Enter the minutes after the hour to run the grabber', defaultt='0', type=xbmcgui.INPUT_NUMERIC)
|
1234 | 1234 | cron_update = str(cron_new_min) + ' ' + str(cron_new_hour) + ' ' + cron_new_weekday + ' * *'
|
1235 | 1235 | return cron_update
|
@@ -1309,7 +1309,7 @@ def epgmod_list_load():
|
1309 | 1309 | epg_modlist_enabled.append(str(e['status']))
|
1310 | 1310 | epg_modlist_enabled = [w.replace('epggrabmodNone', ' ** DISABLED **') for w in epg_modlist_enabled]
|
1311 | 1311 | epg_modlist_enabled = [w.replace('epggrabmodEnabled', ' ') for w in epg_modlist_enabled]
|
1312 |
| - epg_modlist_full = zip(epg_modlist_name, epg_modlist_enabled) |
| 1312 | + epg_modlist_full = list(zip(epg_modlist_name, epg_modlist_enabled)) |
1313 | 1313 | epg_modlist_list = ["%s %s" % x for x in epg_modlist_full]
|
1314 | 1314 | epg_modlist_list, epg_modlist_uuid = (list(t) for t in zip(*sorted(zip(epg_modlist_list, epg_modlist_uuid))))
|
1315 | 1315 | sel_epgmod = dialog.select('Select an EPG grabber module to configure', list=epg_modlist_list)
|
@@ -2644,7 +2644,7 @@ def adapters():
|
2644 | 2644 | adapter_enabled.append(str(adapter_e['params'][0]['value']))
|
2645 | 2645 | adapter_enabled = [w.replace('False', ' ** DISABLED **') for w in adapter_enabled]
|
2646 | 2646 | adapter_enabled = [w.replace('True', ' ') for w in adapter_enabled]
|
2647 |
| - adapters_full = zip(adapter_text, adapter_enabled) |
| 2647 | + adapters_full = list(zip(adapter_text, adapter_enabled)) |
2648 | 2648 | adapters_list = ["%s %s" % x for x in adapters_full]
|
2649 | 2649 | sel_adapter = dialog.select('Select which adapter you would like to configure', list=adapters_list)
|
2650 | 2650 | if sel_adapter >= 0:
|
@@ -2722,7 +2722,7 @@ def channels():
|
2722 | 2722 | channels_enabled.append(str(ch_e['enabled']))
|
2723 | 2723 | channels_enabled = [w.replace('False', ' ** DISABLED **') for w in channels_enabled]
|
2724 | 2724 | channels_enabled = [w.replace('True', ' ') for w in channels_enabled]
|
2725 |
| - channels_full = zip(channels_name, channels_enabled) |
| 2725 | + channels_full = list(zip(channels_name, channels_enabled)) |
2726 | 2726 | channels_list = ["%s %s" % x for x in channels_full]
|
2727 | 2727 | sel_ch = dialog.select('Select a channel to configure', list=channels_list)
|
2728 | 2728 | if sel_ch >= 0:
|
@@ -2987,73 +2987,73 @@ def index():
|
2987 | 2987 | items.append(
|
2988 | 2988 | {
|
2989 | 2989 | 'label': 'Adapters Configuration',
|
2990 |
| - 'path': plugin.url_for(u'adapters'), |
| 2990 | + 'path': plugin.url_for('adapters'), |
2991 | 2991 | 'thumbnail':get_icon_path('adapter'),
|
2992 | 2992 | })
|
2993 | 2993 | items.append(
|
2994 | 2994 | {
|
2995 | 2995 | 'label': 'Networks Configuration',
|
2996 |
| - 'path': plugin.url_for(u'networks'), |
| 2996 | + 'path': plugin.url_for('networks'), |
2997 | 2997 | 'thumbnail':get_icon_path('antenna'),
|
2998 | 2998 | })
|
2999 | 2999 | items.append(
|
3000 | 3000 | {
|
3001 | 3001 | 'label': 'Muxes Configuration',
|
3002 |
| - 'path': plugin.url_for(u'muxes'), |
| 3002 | + 'path': plugin.url_for('muxes'), |
3003 | 3003 | 'thumbnail':get_icon_path('signal'),
|
3004 | 3004 | })
|
3005 | 3005 | items.append(
|
3006 | 3006 | {
|
3007 | 3007 | 'label': 'Channels Configuration',
|
3008 |
| - 'path': plugin.url_for(u'channels'), |
| 3008 | + 'path': plugin.url_for('channels'), |
3009 | 3009 | 'thumbnail':get_icon_path('numlist'),
|
3010 | 3010 | })
|
3011 | 3011 | items.append(
|
3012 | 3012 | {
|
3013 | 3013 | 'label': 'Scan for New Channels',
|
3014 |
| - 'path': plugin.url_for(u'mux_scan'), |
| 3014 | + 'path': plugin.url_for('mux_scan'), |
3015 | 3015 | 'thumbnail':get_icon_path('frequency'),
|
3016 | 3016 | })
|
3017 | 3017 | items.append(
|
3018 | 3018 | {
|
3019 | 3019 | 'label': 'Map Services to Channels',
|
3020 |
| - 'path': plugin.url_for(u'services'), |
| 3020 | + 'path': plugin.url_for('services'), |
3021 | 3021 | 'thumbnail':get_icon_path('folder'),
|
3022 | 3022 | })
|
3023 | 3023 | items.append(
|
3024 | 3024 | {
|
3025 | 3025 | 'label': 'EPG Grabber Configuration',
|
3026 |
| - 'path': plugin.url_for(u'epg'), |
| 3026 | + 'path': plugin.url_for('epg'), |
3027 | 3027 | 'thumbnail':get_icon_path('list'),
|
3028 | 3028 | })
|
3029 | 3029 | items.append(
|
3030 | 3030 | {
|
3031 | 3031 | 'label': 'DVR Configuration',
|
3032 |
| - 'path': plugin.url_for(u'dvr'), |
| 3032 | + 'path': plugin.url_for('dvr'), |
3033 | 3033 | 'thumbnail':get_icon_path('dvr'),
|
3034 | 3034 | })
|
3035 | 3035 | items.append(
|
3036 | 3036 | {
|
3037 | 3037 | 'label': 'Conditional Access Clients',
|
3038 |
| - 'path': plugin.url_for(u'cas'), |
| 3038 | + 'path': plugin.url_for('cas'), |
3039 | 3039 | 'thumbnail':get_icon_path('cas'),
|
3040 | 3040 | })
|
3041 | 3041 | items.append(
|
3042 | 3042 | {
|
3043 | 3043 | 'label': 'Tvh Base Configuration & Backup',
|
3044 |
| - 'path': plugin.url_for(u'tvh'), |
| 3044 | + 'path': plugin.url_for('tvh'), |
3045 | 3045 | 'thumbnail':get_icon_path('settings'),
|
3046 | 3046 | })
|
3047 | 3047 | items.append(
|
3048 | 3048 | {
|
3049 | 3049 | 'label': 'Start Wizard',
|
3050 |
| - 'path': plugin.url_for(u'wizard'), |
| 3050 | + 'path': plugin.url_for('wizard'), |
3051 | 3051 | 'thumbnail':get_icon_path('wand'),
|
3052 | 3052 | })
|
3053 | 3053 | items.append(
|
3054 | 3054 | {
|
3055 | 3055 | 'label': 'Tvheadend Backend: ' + tvh_url + ':' + tvh_port,
|
3056 |
| - 'path': plugin.url_for(u'tvhclient'), |
| 3056 | + 'path': plugin.url_for('tvhclient'), |
3057 | 3057 | 'thumbnail':get_icon_path('server'),
|
3058 | 3058 | })
|
3059 | 3059 |
|
|
0 commit comments