diff --git a/resources/lib/__pycache__/kodimov.cpython-315.pyc b/resources/lib/__pycache__/kodimov.cpython-315.pyc index 74fa591..303f641 100644 Binary files a/resources/lib/__pycache__/kodimov.cpython-315.pyc and b/resources/lib/__pycache__/kodimov.cpython-315.pyc differ diff --git a/resources/lib/__pycache__/movistar.cpython-315.pyc b/resources/lib/__pycache__/movistar.cpython-315.pyc index bfa58e1..d6c3a0e 100644 Binary files a/resources/lib/__pycache__/movistar.cpython-315.pyc and b/resources/lib/__pycache__/movistar.cpython-315.pyc differ diff --git a/resources/lib/kodimov.py b/resources/lib/kodimov.py index 287888c..a82391d 100644 --- a/resources/lib/kodimov.py +++ b/resources/lib/kodimov.py @@ -38,7 +38,7 @@ EXTRA_CHANNELS = [ 'url': 'https://crtvg-tvg2.flumotion.cloud/playlist.m3u8'}, {'id': 'TeleVigo', 'name': 'TeleVigo', 'chno': 155, 'group': 'Galicia', 'logo': 'https://i.imgur.com/4iVmlFa.png', - 'url': 'https://cloud.fastchannel.es/mic/manifiest/hls/televigo/televigo.m3u8'}, + 'url': 'https://stream-us-east-1.getpublica.com/playlist.m3u8?network_id=12687'}, ] AUTOLOGIN_URL = 'https://soter-pf.svp.video.telefonicaservices.com/service/login/autologin?deviceId={device}&deviceType=webplayer&_={ts}' @@ -151,10 +151,9 @@ def network_login(m, account_number): def extra_channels_m3u8(): - items = [] - for c in EXTRA_CHANNELS: - items.append('#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{chno}" group-title="{group}",{name}\n{url}\n\n'.format(**c)) - return ''.join(items) + """Returns [(channel number, m3u8 entry)].""" + return [(c['chno'], '#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{chno}" group-title="{group}",{name}\n{url}\n\n'.format(**c)) + for c in EXTRA_CHANNELS] def write_if_changed(filename, content): diff --git a/resources/lib/movistar.py b/resources/lib/movistar.py index 9b9b6e1..a5e9e2d 100644 --- a/resources/lib/movistar.py +++ b/resources/lib/movistar.py @@ -1418,10 +1418,12 @@ class Movistar(object): if 'cas_id' in t: url += '&cas_id=' + t['cas_id'] item = '#EXTINF:-1 tvg-name="{name}" tvg-id="{id}" tvg-logo="{logo}" tvg-chno="{preset}" {catchup} group-title="Movistar+",{name}\n{stream}\n\n'.format( name=t['name'], id=t['id'], logo=t['logo'], preset=t['preset'], stream=url, catchup='catchup="default" catchup-source="{catchup-id}" catchup-days="7"') - items.append(item) + items.append((int(t['preset'] or 0), item)) if self.add_extra_channels: - items.append(kodimov.extra_channels_m3u8()) - res = '#EXTM3U\n## KodiMov+\n{}'.format(''.join(items)) + items.extend(kodimov.extra_channels_m3u8()) + # Kodi lists channels in file order, so keep it in channel number order. + items.sort(key=lambda x: x[0]) + res = '#EXTM3U\n## KodiMov+\n{}'.format(''.join(i for _, i in items)) return kodimov.write_if_changed(filename, res) def export_epg(self, date=None, duration=2):