diff --git a/addon.xml b/addon.xml index b070249..011cd80 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -28,7 +28,10 @@ 1.2.2: - pfade für neue plugin routing addon angepasst, zerstört leider alte gespeicherte Favoriten, diese müssen neu hinzugefügt werden. 1.2.3: -- hinzufügen von favoriten repariert. +- hinzufügen von favoriten repariert. +1.2.4: +- Neue Sender Hinzugefügt. +- Abspielen von livestreams mit Python3 repariert. resources/icon.png resources/fanart.png diff --git a/changelog.txt b/changelog.txt index e7b5544..7e5aab7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -39,4 +39,7 @@ v1.2.0 v1.2.2: - adapt paths to new plugin routing addon, sadly ruins old saved favourites, the need to be newly added. v1.2.3: -- fixed adding favourites \ No newline at end of file +- fixed adding favourites +v1.2.4: +- add new channels. +- fix playback of livestreams with python3. \ No newline at end of file diff --git a/resources/lib/ids.py b/resources/lib/ids.py index 7f77820..64bf8d6 100644 --- a/resources/lib/ids.py +++ b/resources/lib/ids.py @@ -42,6 +42,11 @@ "tlc_de": "tlc-de-24x7", "popuptv": "popuptv-24x7", # puls24 "puls4_at": "puls4-24x7", + "servustv": "servustv-at", + "schautv": "schautv-at-hd", + "ric": "ric-at", + "kronehittv": "kronehittv-at", + "popuptv2": "popuptv2", "orf1": "orf1-at", "orf2": "orf2-at", "atv": "atv-24x7", @@ -106,9 +111,16 @@ config_tag = {} def get_livestream_config_url(livestream_id): - if livestream_id == "orf1" or livestream_id == "orf2": + if livestream_id == "orf1" or livestream_id == "orf2" or livestream_id == "kronehittv": return live_config_url+live_config_ids["orf"] - elif livestream_id == "atv" or livestream_id == "atv2" or livestream_id == "puls4_at" or livestream_id == "popuptv": + elif (livestream_id == "atv" + or livestream_id == "atv2" + or livestream_id == "puls4_at" + or livestream_id == "popuptv" + or livestream_id == "popuptv2" + or livestream_id == "servustv" + or livestream_id == "schautv" + or livestream_id == "ric"): return live_config_url+live_config_ids["puls4_and_atv_at"] elif "kabeleins" in livestream_id: return live_config_url+live_config_ids[livestream_id.replace("kabeleins", "kabel1")] diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index 7c5cd80..cf20f83 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -157,13 +157,27 @@ def show_category(category_id): play_livestream, "puls4_at"), get_listitem(name="PULS 4", channel=channel, no_puls4=False)) channel = get_channel(json_data, "Popup") addDirectoryItem(plugin.handle, plugin.url_for( - play_livestream, "popuptv"), get_listitem(name="Popup TV", channel=channel, no_puls4=False)) + play_livestream, "popuptv"), get_listitem(name="Puls 24", channel=channel, no_puls4=False)) channel = get_channel(json_data, "ATV") addDirectoryItem(plugin.handle, plugin.url_for( play_livestream, "atv"), get_listitem(name="ATV", channel=channel)) channel = get_channel(json_data, "ATV2") addDirectoryItem(plugin.handle, plugin.url_for( play_livestream, "atv2"), get_listitem(name="ATV 2", channel=channel)) + channel = get_channel(json_data, "servustv") + addDirectoryItem(plugin.handle, plugin.url_for( + play_livestream, "servustv"), get_listitem(name="Servus TV Österreich", channel=channel)) + channel = get_channel(json_data, "schautv") + addDirectoryItem(plugin.handle, plugin.url_for( + play_livestream, "schautv"), get_listitem(name="SchauTV", channel=channel)) + channel = get_channel(json_data, "ric") + addDirectoryItem(plugin.handle, plugin.url_for( + play_livestream, "ric"), get_listitem(name="RIC", channel=channel)) + channel = get_channel(json_data, "popuptv") + addDirectoryItem(plugin.handle, plugin.url_for( + play_livestream, "popuptv2"), get_listitem(name="CineplexxTV", channel=channel)) + addDirectoryItem(plugin.handle, plugin.url_for( + play_livestream, "kronehittv"), get_listitem(name="Kronehit TV")) addDirectoryItem(plugin.handle, plugin.url_for( show_category, "austria"), ListItem(kodiutils.get_string(32026)), True) addDirectoryItem(plugin.handle, plugin.url_for( @@ -884,7 +898,9 @@ def get_url(url, headers={}, cache=False, critical=False): new_headers = {} new_headers.update(headers) if cache == True: - new_headers.update({"If-None-Match": ids.get_livestream_config_tag(url)}) + cache_tag = ids.get_livestream_config_tag(url) + if cache_tag != None: + new_headers.update({"If-None-Match": cache_tag}) new_headers.update({"User-Agent":"okhttp/3.10.0", "Accept-Encoding":"gzip"}) try: request = urlopen(Request(url, headers=new_headers)) @@ -933,7 +949,10 @@ def get_video_source_request_token(access_token="", client_location="", client_n def get_listitem(name="", icon="", fanart="", channel={}, no_puls4=True): if channel: - listitem = ListItem(channel["name"]) + if name: + listitem = ListItem(name) + else: + listitem = ListItem(channel["name"]) listitem.setProperty('IsPlayable', 'true') if no_puls4: listitem.setLabel(listitem.getLabel().replace("Puls4 ", "")) @@ -945,7 +964,7 @@ def get_listitem(name="", icon="", fanart="", channel={}, no_puls4=True): listitem.setArt({'icon':images["icon_1"], 'thumb':images["icon_1"], 'poster':images["icon_1"]}) if "next_program" in channel: #'Title': channel["name"] - listitem.setInfo(type='Video', infoLabels={'Title': listitem.getLabel(), 'Plot': channel["next_program"]["name"]+'[CR]'+channel["next_program"]["description"], 'mediatype': 'video'}) + listitem.setInfo(type='Video', infoLabels={'Title': listitem.getLabel(), 'Plot': channel["next_program"]["name"]+'[CR]'+(channel["next_program"]["description"] if channel["next_program"]["description"] != None else ""), 'mediatype': 'video'}) program_images = json.loads(channel["next_program"]["images_json"]) if program_images: listitem.setArt({'fanart' : program_images["image_base"]})