Skip to content

Commit

Permalink
1.2.4:
Browse files Browse the repository at this point in the history
- add new channels.
- fix playback of livestreams with python3.
  • Loading branch information
fayer3 committed Dec 4, 2019
1 parent 5f36a96 commit 47a781a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
7 changes: 5 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.2.3" provider-name="fayer3">
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.2.4" provider-name="fayer3">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.routing" version="0.2.0"/>
Expand Down Expand Up @@ -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.</news>
- hinzufügen von favoriten repariert.
1.2.4:
- Neue Sender Hinzugefügt.
- Abspielen von livestreams mit Python3 repariert.</news>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.png</fanart>
Expand Down
5 changes: 4 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
- fixed adding favourites
v1.2.4:
- add new channels.
- fix playback of livestreams with python3.
16 changes: 14 additions & 2 deletions resources/lib/ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")]
Expand Down
27 changes: 23 additions & 4 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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 ", ""))
Expand All @@ -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"]})
Expand Down

0 comments on commit 47a781a

Please sign in to comment.