Skip to content

Commit

Permalink
Änderungen / Korrekturen siehe changelog.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
rols1 committed Oct 8, 2023
1 parent 52e1261 commit 45f2d47
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 68 deletions.
2 changes: 1 addition & 1 deletion 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.ardundzdf" name="ARDundZDF" version="4.8.5+nexus" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.video.ardundzdf" name="ARDundZDF" version="4.8.6+nexus" provider-name="rols1 (rols1@gmx.de)">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.kodi-six" />
Expand Down
18 changes: 9 additions & 9 deletions ardundzdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

# VERSION -> addon.xml aktualisieren
# <nr>147</nr> # Numerierung für Einzelupdate
VERSION = '4.8.5'
VDATE = '02.10.2023'
VERSION = '4.8.6'
VDATE = '08.10.2023'


# (c) 2019 by Roland Scholz, rols1@gmx.de
Expand Down Expand Up @@ -1526,7 +1526,7 @@ def AudioStartLive(title, sender='', streamUrl='', myhome='', img='', Plot=''):
path = "https://api.ardaudiothek.de/organizations" # api=Webjson
page = Dict("load", "AudioSender", CacheTime=CacheTime)
if page == False or page == '': # Cache miss od. leer - vom Sender holen
page, msg = get_page(path=path, JsonPage=True)
page, msg = get_page(path=path)
Dict("store", "AudioSender", page)
msg1 = "Fehler in AudioStartLive:"
if page == '':
Expand Down Expand Up @@ -1615,7 +1615,7 @@ def AudioSenderPrograms(org=''):
path = "https://api.ardaudiothek.de/organizations" # api=Webjson
page = Dict("load", "AudioSender", CacheTime=CacheTime)
if page == False or page == '': # Cache miss od. leer - vom Sender holen
page, msg = get_page(path=path, JsonPage=True)
page, msg = get_page(path=path)
Dict("store", "AudioSender", page)
msg1 = "Fehler in AudioStartLive:"
if page == '':
Expand Down Expand Up @@ -6437,7 +6437,7 @@ def get_sort_playlist(): # Senderliste für EPG + Recording
if 'ARDSource' in link: # Streamlink für ARD-Sender holen,
title_sender = stringextract('<hrefsender>', '</hrefsender>', item)
link='' # Reihenfolge an Playlist anpassen
# Zeile ard_streamlinks: "webtitle|href|thumb|tagline"
# Zeile ard_streamlinks: "webtitle|href|thumb|linkid"
for line in ard_streamlinks:
#PLog("ARDSource: %s || %s" % (title_sender, str(items)))
items = line.split('|')
Expand All @@ -6450,7 +6450,7 @@ def get_sort_playlist(): # Senderliste für EPG + Recording
if 'IPTVSource' in link: # Streamlink für private Sender holen
title_sender = stringextract('<title>', '</title>', item)
link='' # Reihenfolge an Playlist anpassen
# Zeile iptv_streamlinks: "Sender|href|thumb|tagline"
# Zeile iptv_streamlinks: "Sender|href|thumb|''"
for line in iptv_streamlinks:
#PLog("IPTVSource: %s || %s" % (title_sender, str(items)))
items = line.split('|')
Expand Down Expand Up @@ -8623,7 +8623,7 @@ def ZDF_FlatListEpisodes(sid):
headers="{'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', \
'Referer': '%s', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': 'application/json, text/plain, */*'}"
path = "https://zdf-cdn.live.cellular.de/mediathekV2/document/%s" % sid
page, msg = get_page(path=path, header=headers, JsonPage=True)
page, msg = get_page(path=path, header=headers)
if page == "":
msg1 = "Abbruch in ZDF_FlatListEpisodes:"
msg2 = "Die Serien-ID [B]%s[/B] ist nicht (mehr)" % sid
Expand Down Expand Up @@ -9427,7 +9427,7 @@ def m3satSourcesHBBTV(weburl, title):

header = "{'Host': 'hbbtv.zdf.de', 'content-type': 'application/vnd.hbbtv.xhtml+xml'}"
path = base + url
page, msg = get_page(path, header=header, JsonPage=True)
page, msg = get_page(path, header=header)
if page == '':
msg1 = u'HBBTV-Quellen nicht vorhanden / verfügbar'
msg2 = u'Video: %s' % title
Expand Down Expand Up @@ -9553,7 +9553,7 @@ def ZDFSourcesHBBTV(title, scms_id):

# Call funktioniert auch ohne Header:
header = "{'Host': 'hbbtv.zdf.de', 'content-type': 'application/vnd.hbbtv.xhtml+xml'}"
page, msg = get_page(path=url, header=header, JsonPage=True)
page, msg = get_page(path=url, header=header)
if page == '':
msg1 = u'HBBTV-Quellen nicht vorhanden / verfügbar'
msg2 = u'Video: %s' % title
Expand Down
27 changes: 27 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,33 @@ CHANGE HISTORY
max_col 97
--------------

08.10.2023 4.8.6
AudioStartLive (Audiothek): py2_decode(Plot) - relevant für PYTHON2.
time_translate (Modul util): re.search-Code für Verfügbarkeitswarnung ver-
bessert (CodeQL-alert: Inefficient regular expression).
ARDStart (ARDnew): Cache auf Startseite begrenzt (Überschneidung mit Menüs
RETRO und Entdecken möglich).
ShowFavs: Notification bei fehlenden Inhalten (Favoriten/Merkliste).
Main: im Infotext des Buttons Merkliste Setting-Hinweis hinzugefügt, falls
externe Merkliste gewählt.
addDir: li.setInfo für Kodi V20 (Nexus) ersetzt durch li.getVideoInfoTag
(Trigger KODI_MAJOR, Zusatz-Infos in addDir).
ARDSportWDR: Basketball-WM aus Startseite entfernt.
arte-Modul: Anpassungen an api-Version 4 (error für V3) in EPG_Today (Link)
und GetContent (json-key).
ZDF: Auswertung recommendation-Inhalte ergänzt - Anpassungen in ZDF_RubrikSingle
(ohne Cache, DictID leer), ZDF_PageMenu (DictID auf urlkey-Basis), ZDF_Rubriken
(stream=url).
ZDF_PageMenu: application/json gegen IncompleteRead-error.
Main_TIVI (Modul childs): auskommentierten Code entfernt (Suche, Sendungen der
letzten 7 Tage).
get_ARDstreamlinks (util): Liste ard_streamlinks mit linkid ergänzt (Verwendung
für programm-api.ard).
get_page (util): json-Behandlung entfernt (obsolet, json.loads durch Aufrufer),
Call-Anpassung in AudioStartLive, ZDF_FlatListEpisodes, m3satSourcesHBBTV,
ZDFSourcesHBBTV, get_ZDFstreamlinks, get_ARDstreamlinks, SearchARDundZDFnew,
ARDSearchnew, SingleVideo (arte).

24.09.2023 4.8.5
ARD Senderwahl: überarbeitet, um Überschreiben der Senderwahl durch Return-Menü
von Kodi zu vermeiden - neue Funktion ARD_CurSender_set, Anpassungen in ARDnew,
Expand Down
14 changes: 7 additions & 7 deletions resources/lib/ARDnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
################################################################################
# <nr>60</nr> # Numerierung für Einzelupdate
# Stand: 24.09.2023
# Stand: 04.10.2023

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -314,13 +314,13 @@ def ARDStart(title, sender, widgetID='', path='', homeID=''):
page, msg = get_page(path, header=headers)
else:
page = Dict("load",DictID,CacheTime=ARDStartCacheTime) # Cache: 5 min
if not page: # nicht vorhanden oder zu alt -> neu laden
page, msg = get_page(path, header=headers) # vom Sender holen
if not page: # nicht vorhanden oder zu alt -> vom
page, msg = get_page(path, header=headers) # Sender holen
if page:
icon = R(ICON_MAIN_ARD)
xbmcgui.Dialog().notification("Cache %s:" % DictID,"Haltedauer 5 Min",icon,3000,sound=False)
Dict('store', DictID, page) # json-Datei -> Dict, ca. 2,5 MByte mit Teasern

Dict('store', DictID, page) # json-Datei -> Dict, 1 - 2,5 MByte mit Teasern,
# je nach Sender
if page == "":
msg1 = 'Fehler in ARDStart:'
msg2 = msg
Expand Down Expand Up @@ -2361,7 +2361,7 @@ def SearchARDundZDFnew(title, query='', pagenr=''):
path = 'https://api.ardmediathek.de/search-system/mediathek/%s/search/vods?query=%s&pageNumber=%s&pageSize=24' % (sender, query_ard, pageNumber)
icon = R(ICON_SEARCH)
xbmcgui.Dialog().notification("ARD-Suche",query_lable,icon,1000, sound=False)
page, msg = get_page(path,JsonPage=True)
page, msg = get_page(path)

vodTotal = stringextract('"totalElements":', '}', page) # Beiträge?
gridlist = blockextract( '"mediumTitle":', page) # Sicherung
Expand Down Expand Up @@ -2529,7 +2529,7 @@ def ARDSearchnew(title, sender, offset=0, query='', homeID=""):
PLog(query)
path = 'https://api.ardmediathek.de/search-system/mediathek/%s/search/vods?query=%s&pageNumber=%s&pageSize=24' % (sender, query, offset)

page, msg = get_page(path,JsonPage=True)
page, msg = get_page(path)
PLog(len(page))
if page == '':
msg1 = "Fehler in ARDSearchnew, Suche: %s" % query
Expand Down
10 changes: 5 additions & 5 deletions resources/lib/arte.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
################################################################################
# <nr>37</nr> # Numerierung für Einzelupdate
# Stand: 29.09.2023
# Stand: 04.10.2023

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -726,7 +726,7 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36',\
'Accept': 'application/json'}"

page, msg = get_page(path1, JsonPage=True, do_safe=False) # api_v2_Call
page, msg = get_page(path1, do_safe=False) # api_v2_Call
if page == '':
msg1 = L(u'Fehler in SingleVideo') + ": %s" % title
msg2 = msg
Expand All @@ -749,7 +749,7 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):
hls_add = ", HLS-Streams: [B]Trailer[/B]"

#------------------------------------------------------------- # HBBTV- + MP4-Quellen
page, msg = get_page(path2, JsonPage=True, do_safe=False, header=header) # api_opa_Call_1
page, msg = get_page(path2, do_safe=False, header=header) # api_opa_Call_1
#RSave('/tmp/x_artestreams_opa1.json', py2_encode(page)) # Debug
if page == '':
PLog("error_api_opa_Call_1")
Expand All @@ -758,12 +758,12 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):
streams = stringextract('"videoStreams":', ']', page)
stream_hbbtv = stringextract('hbbtv":', '}', streams)
stream_hbbtv = stringextract('href": "', '"', stream_hbbtv)
#stream_web = stringextract('web":', '}', streams) # nicht genutzt - s. api_v2_Call
#stream_web = stringextract('web":', '}', streams) # nicht genutzt - s. api_v2_Call
#stream_web = stringextract('href": "', '"', stream_web)
#PLog("stream_web: " + stream_web);
PLog("stream_hbbtv: " + stream_hbbtv)

page, msg = get_page(path=stream_hbbtv, JsonPage=True, do_safe=False, header=header) # api_opa_Call_2
page, msg = get_page(path=stream_hbbtv, do_safe=False, header=header) # api_opa_Call_2
if page == '':
PLog("error_api_opa_Call_1")
#RSave('/tmp/x_artestreams_opa2.json', py2_encode(page)) # Debug
Expand Down
17 changes: 3 additions & 14 deletions resources/lib/childs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
################################################################################
#
# <nr>22</nr> # Numerierung für Einzelupdate
# Stand: 23.09.2023
# Stand: 02.10.2023

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -264,29 +264,18 @@ def Main_TIVI(title=''):
(quote(title), "ZDF-tivi", quote(func))
addDir(li=li, label=title, action="dirList", dirID="resources.lib.yt.MVWSearch", fanart=GIT_ZDFTIVI,
thumb=R("suche_mv.png"), tagline=tag, summary=summ, fparams=fparams)

# title="Suche in ZDFtivi"
# summ = "Suche Videos in KIKA"
# fparams="&fparams={'query': '', 'title': '%s'}" % title
# addDir(li=li, label=title, action="dirList", dirID="resources.lib.childs.Tivi_Search", fanart=GIT_ZDFTIVI,
# thumb=R(ICON_ZDF_SEARCH), fparams=fparams)

title='tivi_Startseite'
fparams="&fparams={'ID': '%s'}" % (title)
addDir(li=li, label=title , action="dirList", dirID="ardundzdf.ZDF_Start", fanart=GIT_ZDFTIVI,
thumb=GIT_TIVIHOME, tagline=title, fparams=fparams)

# title='Sendungen der letzten 7 Tage'
# fparams="&fparams={}"
# addDir(li=li, label=title , action="dirList", dirID="resources.lib.childs.Tivi_Woche", fanart=GIT_ZDFTIVI,
# thumb=GIT_CAL, tagline=title, fparams=fparams)

title='Sendungen A-Z | 0-9'
title='tivi_Sendungen A-Z | 0-9'
fparams="&fparams={}"
addDir(li=li, label=title, action="dirList", dirID="resources.lib.childs.Tivi_AZ", fanart=GIT_ZDFTIVI,
thumb=GIT_AZ, tagline=title, fparams=fparams)

title='ZDFchen'
title='tivi_ZDFchen'
tag = "Für Kinder bis 6 Jahre"
thumb = "https://www.zdf.de/assets/zdfchen-buehne-m-song-100~936x520?cb=1658852787035"
fparams="&fparams={'ID': '%s', 'homeID': 'Kinderprogramme'}" % title
Expand Down
Loading

0 comments on commit 45f2d47

Please sign in to comment.