Skip to content

Commit

Permalink
changes see changelog.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
rols1 committed Feb 4, 2024
1 parent 28d4a10 commit fb480b7
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 48 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.9.5+nexus" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.video.ardundzdf" name="ARDundZDF" version="4.9.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
57 changes: 53 additions & 4 deletions ardundzdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

# VERSION -> addon.xml aktualisieren
# <nr>176</nr> # Numerierung für Einzelupdate
VERSION = '4.9.5'
VDATE = '29.01.2024'
VERSION = '4.9.6'
VDATE = '04.02.2024'


# (c) 2019 by Roland Scholz, rols1@gmx.de
Expand Down Expand Up @@ -982,8 +982,12 @@ def AddonInfos():
searchwords = os.path.join(ADDON_DATA, "search_ardundzdf")
a8 = u"%s [B]Suchwortliste:[/B] %s" % (t,searchwords)
log = xbmc.translatePath("special://logpath")
log = os.path.join(log, "kodi.log")
a9 = u"%s [B]Debug-Log:[/B] %s" % (t, log)
log = os.path.join(log, "kodi.log")
size = humanbytes(os.path.getsize(log))
size = "[B]%s[/B]" % size
if "GB" in size or "TB" in size:
size = "[COLOR red]%s !!![/COLOR]" % size
a9 = u"%s [B]Debug-Log:[/B] %s | %s" % (t, log, size)
a10 = u"%s [B]TV-und Event-Livestreams:[/B] %s/%s" % (t, PluginAbsPath, "resources/livesenderTV.xml")

p3 = u"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" % (a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
Expand Down Expand Up @@ -7878,6 +7882,15 @@ def ZDF_PageMenu(DictID, jsonObject="", urlkey="", mark="", li="", homeID=""):
title = repl_json_chars(title)
tag = repl_json_chars(tag)
if typ=="video": # Videos
if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(entry))):
filtered = True
break
if filtered:
PLog('filtered_1: <%s> in %s ' % (item, title))
continue
if "channel" in entry: # Zusatz Sender
sender = entry["channel"]
tag = "%s | %s" % (tag, sender)
Expand Down Expand Up @@ -8033,6 +8046,15 @@ def ZDF_Rubriken(path, title, DictID, homeID=""):
stream = url
tag = tag.replace("Folgeseiten", "Video")
if typ == "video":
if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(entry))):
filtered = True
break
if filtered:
PLog('filtered_2: <%s> in %s ' % (item, title))
continue
if "channel" in entry: # Zusatz Sender
sender = entry["channel"]
tag = "%s | %s" % (tag, sender)
Expand Down Expand Up @@ -8255,6 +8277,15 @@ def ZDF_RubrikSingle(url, title, homeID=""):
if(entry["type"]=="video"): # Videos am Seitenkopf
# path = 'stage|%d' % i # entf. hier
PLog("stream: " + stream)
if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(entry))):
filtered = True
break
if filtered:
PLog('filtered_3: <%s> in %s ' % (item, title))
continue
if "channel" in entry: # Zusatz Sender
sender = entry["channel"]
tag = "%s | %s" % (tag, sender)
Expand Down Expand Up @@ -8794,6 +8825,15 @@ def ZDF_Verpasst(title, zdfDate, sfilter='Alle ZDF-Sender', DictID=""):
if sfilter != channel: # filtern
continue
tag = "%s | Sender: [B]%s[/B]" % (tag,channel)
if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(entry))):
filtered = True
break
if filtered:
PLog('filtered_4: <%s> in %s ' % (item, title))
continue

PLog("Satz4:")
PLog(tag); PLog(title); PLog(stream);
Expand Down Expand Up @@ -9054,6 +9094,15 @@ def ZDF_FlatListEpisodes(sid):
if season == '':
PLog("skip_no_season: " + str(folge)[:60])
continue
if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(folge))):
filtered = True
break
if filtered:
PLog('filtered_5: <%s> in %s ' % (item, title))
continue

summ_par= summ.replace('\n', '||')
tag_par= tag.replace('\n', '||')
Expand Down
34 changes: 33 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ CHANGE HISTORY
max_col 97
--------------

04.01.2024 4.9.6
Main_XL (TagesschauXL): Hinw. auf geringe Videoqualität 480x270 (Investigativ,
Faktenfinder).
XL_BilderClusterSingle (TagesschauXL): Auswertung Slider-Bilder ergänzt.
time_translate (util): Sommerzeit 2024 ergänzt.
XL_SearchContent (TagesschauXL): Nutzung make_mark (util) für Fett-Markierung
der Suchbegriffe.
Bildergalerien: Löschen leerer Bildverz. ergänzt - Aktualisierung my3Sat,
TagesschauXL, Haupt-PRG. Neue Funktion DelEmptyDirs (util).
Haupt-PRG: Bereinigung Thumbscache ARDNeu_Startpage ergänzt (Setting Slide
Shows).
AddonInfos: Größe der Logdatei ergänzt, einschl. Kennzeichnung ab 1 GB.
ARDRubriken: fehlendes LF-Zeichen ergänzt ("%s\Bild: %s" -> "%s\nBild: %s").
TV-Livestreams -> Regional: Abgleich bei IPTV-Quellen mit "<tvg-name>" statt
"<hrefsender>".
TV-Livestreams -> Überregional: 2 eingestellte Sender Deutsche Welle aus
livesenderTV.xml entfernt, verbleibend: "Deutsche Welle (EN)".
Rubriken (my3Sat): fehlendes Container-Merkmal (..is-white, ..is-dark) für
weitere Inhalte ergänzt, get_title erweitert, neue Funktion del_footer.
m3satSourcesHBBTV (Haupt-PRG): bei Fehlen von HBBTV-Quellen Dialog ersetzt
durch notification.
my3Sat: Bereinigung Cache für SophoraTeaser ergänzt (Setting Inhaltstexte).
ZDF_Start (Haupt-PRG): Aufruf tivi_ZDFchen-Seite korrigiert.
Modul phoenix: nicht mehr benötigtes Setting "..nur Beiträge mit Videos.."
entfernt, dto. Wiki (Settings Module).
Ausschluss-Filter (Beiträge von ARD und ZDF): verlorenen Code wiederhergestellt,
Anpassung get_json_content + ARDVerpasst_get_json (ARDnew), ZDF_PageMenu,
ZDF_Rubriken, ZDF_RubrikSingle, ZDF_Verpasst. Zusätz. Notification für context-
Umschaltung in FilterToolsWork (tools).
get_next_url (arte): Wegfall api-internal-Call, neuen Call für Web-json-Quellen
angepasst ("/api/emac/" -> "www.arte.tv/api/rproxy/emac/").

21.01.2024 4.9.5
ARDStartSingle: Ausfilterung .ts-Link bei Streamquellen (Link o. Zertifikat).
AddonStartlist: sub_path, seekPos und video_dur in Param-Liste ergänzt, Anpas-
Expand Down Expand Up @@ -52,7 +84,7 @@ CHANGE HISTORY
ZDF_getStrmList: Austausch os.path.isdir -> os.path.exists (strmpath), Abbruch-
Dialog bei strmpath-Problem.
Modul util: neue Funktion get_sqlite_Cursor (DB-Connect zu MyVideos*.db),
Nutzung durch show_strm_element
Nutzung durch show_strm_element.

24.12.2023 4.9.3
ZDF_RubrikSingle: Fix Erkennung von Navigations-Menüs (Suche in jsonObject
Expand Down
43 changes: 31 additions & 12 deletions resources/lib/ARDnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
################################################################################
# <nr>68</nr> # Numerierung für Einzelupdate
# Stand: 07.01.2024
# Stand: 26.01.2024

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -577,7 +577,7 @@ def ARDRubriken(li, path="", page="", homeID=""):

tag = "Folgeseiten"
if img_alt:
tag = u"%s\Bild: %s" % (tag, img_alt)
tag = u"%s\nBild: %s" % (tag, img_alt)

ID = 'ARDStartRubrik'
PLog('Satz_cont2:');
Expand Down Expand Up @@ -1011,6 +1011,15 @@ def ARD_FlatListEpisodes(path, title):
if title == '': # skipped
continue
summ_par = summ.replace('\n', '||')
if SETTINGS.getSetting('pref_usefilter') == 'true': # Filter
filtered=False
for fil in AKT_FILTER:
if up_low(fil) in py2_encode(up_low(str(item))):
filtered = True
break
if filtered:
PLog('filtered_6: <%s> in %s ' % (item, title))
continue

url=py2_encode(url); title=py2_encode(title); summ_par=py2_encode(summ_par);
fparams="&fparams={'path': '%s', 'title': '%s', 'summary': '%s', 'ID': '%s'}" %\
Expand Down Expand Up @@ -1804,16 +1813,6 @@ def get_json_content(li, page, ID, mark='', mehrzS='', homeID=""):
pubServ = s["publicationService"]["name"] # publicationService (Sender)
if pubServ:
summ = "%sSender: %s" % (summ, pubServ)

if SETTINGS.getSetting('pref_usefilter') == 'true': # Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(s))):
filtered = True
break
if filtered:
PLog('filtered: <%s> in %s ' % (item, title))
continue

PLog('Satz:');
PLog(mehrfach); PLog(typ); PLog(title); PLog(href); PLog(img);
Expand Down Expand Up @@ -1843,6 +1842,16 @@ def get_json_content(li, page, ID, mark='', mehrzS='', homeID=""):
if summ_new:
summ = summ_new

if SETTINGS.getSetting('pref_usefilter') == 'true': # Ausschluss-Filter
filtered=False
for item in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(s))):
filtered = True
break
if filtered:
PLog('filtered_7: <%s> in %s ' % (item, title))
continue

if SETTINGS.getSetting('pref_video_direct') == 'true': # Sofortstart?
mediatype='video'

Expand Down Expand Up @@ -2865,6 +2874,16 @@ def ARDVerpasst_get_json(li, timeSlots, homeID, sender):
except Exception as exception:
PLog("Verpasst_json_error: " + str(exception))

if SETTINGS.getSetting('pref_usefilter') == 'true': # Filter
filtered=False
for fil in AKT_FILTER:
if up_low(item) in py2_encode(up_low(str(s))):
filtered = True
break
if filtered:
PLog('filtered_8: <%s> in %s ' % (item, title))
continue

PLog("Satz:")
PLog(title); PLog(href); PLog(path); PLog(img); PLog(summ[:60]);
PLog(duration); PLog(availableTo);
Expand Down
7 changes: 6 additions & 1 deletion resources/lib/my3Sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
ADDON_DATA = os.path.join("%sardundzdf_data") % USERDATA

# Anpassung Kodi 20 Nexus: "3.0.0" -> "3."
if check_AddonXml('"xbmc.python" version="3.'): # ADDON_DATA-Verzeichnis anpasen
if check_AddonXml('"xbmc.python" version="3.'): # ADDON_DATA-Verzeichnis anpasen
PLog('my3Sat_python_3.x.x')
ADDON_DATA = os.path.join("%s", "%s", "%s") % (USERDATA, "addon_data", ADDON_ID)
WATCHFILE = os.path.join(ADDON_DATA, "merkliste.xml")
Expand All @@ -92,6 +92,11 @@
SUBTITLESTORE = os.path.join(ADDON_DATA, "subtitles")
TEXTSTORE = os.path.join(ADDON_DATA, "Inhaltstexte")

days = int(SETTINGS.getSetting('pref_TEXTE_store_days'))
SophoraTeaser = os.path.join(TEXTSTORE, "SophoraTeaser")
ClearUp(SophoraTeaser, days*86400 ) # Cache SophoraTeaser bereinigen


DEBUG = SETTINGS.getSetting('pref_info_debug')
NAME = 'ARD und ZDF'

Expand Down
5 changes: 5 additions & 0 deletions resources/lib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,16 @@ def FilterToolsWork(action):
dialog.textviewer(title, filter_list,usemono=True)

if action == 'state_change': # aus Kontextmenü
msg1 = "Ausschluss-Filter:"
icon = R(ICON_FILTER)
if SETTINGS.getSetting('pref_usefilter') == 'true':
SETTINGS.setSetting('pref_usefilter','false')
msg2 = u'AUSgeschaltet'
else:
SETTINGS.setSetting('pref_usefilter','true')
msg2 = u'EINgeschaltet'
xbmc.executebuiltin('Container.Refresh')
xbmcgui.Dialog().notification(msg1,msg2,icon,3000)

return

Expand Down
22 changes: 14 additions & 8 deletions resources/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,11 @@ def name(**variables):
s = [x for x in variables]
return s[0]
#----------------------------------------------------------------
# Dateien löschen älter als seconds
# Dateien löschen älter als seconds - nicht rekursiv
# directory = os.path.join(path)
# seconds = int (1 Tag=86400, 1 Std.=3600)
# Ältere Ordner werden ohne Leertest entfernt!
# Ältere enthaltene Ordner werden ohne Leertest entfernt
# (nur 1 Ebene!)
def ClearUp(directory, seconds, keep_dirs=False):
PLog('ClearUp: %s, sec: %s' % (directory, seconds))
PLog('älter als: ' + seconds_translate(seconds, days=True))
Expand All @@ -549,10 +550,11 @@ def ClearUp(directory, seconds, keep_dirs=False):
cnt_files=0; cnt_dirs=0
try:
globFiles = '%s/*' % directory
files = glob.glob(globFiles)
files = glob.glob(globFiles) # leer, fehlend -> leere Liste
PLog("ClearUp: globFiles " + str(len(files)))
# PLog(" globFiles: " + str(files))
for f in files:
#PLog(f)
#PLog(os.stat(f).st_mtime)
#PLog(now - seconds)
if os.stat(f).st_mtime < (now - seconds):
Expand Down Expand Up @@ -3552,6 +3554,7 @@ def PlayVideo(url, title, thumb, Plot, sub_path=None, playlist='', seekTime=0, M
else: # false, None od. Blank - Playlist
PLog('PlayVideo_Start: direkt, playlist: %s' % playlist)
line = Dict("load", 'Rekurs_check', CacheTime=10) # Dict-Abgleich url/Laufzeit
# Rekursion unter Nexus nicht mehr beobachtet - mit Auslaufen von Matrix entfernen
PLog(line)
oldurl=''
if line != False: # Rekursions-Check erforderlich
Expand Down Expand Up @@ -4029,11 +4032,14 @@ def ShowSeekPos(player, url): # "Streamuhrzeit"
if linkid: # Sendungsnavigation: ARD-EPG für Zeitstrahl laden
buf_events, event_end = get_ARD_LiveEPG(epg_url, title_sender, date_format, now, TotalTime)
event_end = int(event_end)
header = "Sendungen (r. Maustaste)"
header = u"Sendungen (Zurück, rechte Maustaste)"
txt = "Anzahl Sendungen: %d" % len(buf_events)
dur=10000
if len(buf_events) == 0:
txt = "KEINE weitere Sendung"
xbmcgui.Dialog().notification(header, txt, icon,4000, sound=True)
header = u"Sendungen"
txt = u"KEINE weitere Sendung"
dur=5000
xbmcgui.Dialog().notification(header, txt, icon,dur, sound=True)
KeyListener_run=True

PLog("buf_events: %d" % len(buf_events))
Expand All @@ -4059,7 +4065,7 @@ def ShowSeekPos(player, url): # "Streamuhrzeit"
p_list.append(p) # 3 sec sync-Check

if len(p_list) >= 3:
if max(p_list) < 1: # nach 3 sec ist < 1 ein Sync-Indiz
if max(p_list) < 1: # nach 3 sec ist < 1 ein Sync-Error-Indiz
PLog("p_list_syncfail: %d, %d" % (p_list[-1], p_list[0]))
syncfail = True
p_list=[]
Expand Down Expand Up @@ -4128,7 +4134,7 @@ def ShowSeekPos(player, url): # "Streamuhrzeit"
event_start, title, sD_uhr = item.split("|")
show_list.append("%s | %s" % (sD_uhr, title))

heading = "Sendungen im Zeitpuffer | Auswahl oder Abbruch"
heading = "Sendungen im Zeitpuffer | Auswahl"
ret = xbmcgui.Dialog().select(heading, show_list, preselect=0) # Dialog
if ret >= 0: # Auswahl?
new_event = buf_events[ret]
Expand Down
20 changes: 0 additions & 20 deletions resources/livesenderTV.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,6 @@
<EPG_ID>TAG24</EPG_ID>
<date>11.04.2021</date>
</item>
<item>
<title>Deutsche Welle</title>
<hrefsender>Deutsche Welle</hrefsender>
<tvg-name>Deutsche Welle</tvg-name>
<link>IPTVSource|/jnk22/kodinerds-iptv/blob/master/iptv/kodi/kodi.m3u</link>
<thumbnail>tvg-logo</thumbnail>
<imgsource></imgsource>
<EPG_ID>DWTV</EPG_ID>
<date>21.01.2024</date>
</item>
<item>
<title>Deutsche Welle+</title>
<hrefsender>Deutsche Welle+</hrefsender>
<tvg-name>Deutsche Welle+</tvg-name>
<link>IPTVSource|/jnk22/kodinerds-iptv/blob/master/iptv/kodi/kodi.m3u</link>
<thumbnail>tvg-logo</thumbnail>
<imgsource></imgsource>
<EPG_ID>DWTV</EPG_ID>
<date>21.01.2024</date>
</item>
<item>
<title>Deutsche Welle (EN)</title>
<hrefsender>Deutsche Welle (EN)</hrefsender>
Expand Down
1 change: 0 additions & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
values="25%|50%|75%|100%"/>
<setting label="Zuletzt-gesehen-Liste: max. Anzahl" type="select" values="50|100|200|500" default="100" id="pref_max_videos_startlist"/>
<setting label="Modul ARD Neu: Mehr-Beiträge zeigen (thematisch ähnliche)" type="bool" id="pref_more" default="true"/>
<setting label="Modul phoenix: nur Beiträge mit Videos, keine Sendungshinweise" type="bool" id="pref_only_phoenix_videos" default="false"/>
<setting type="sep"/>
<setting label="Bildersammlungen: Bildinfos als Wasserzeichen" type="bool" id="pref_watermarks" default="false"/>
<setting label="Bildersammlungen: Fontgröße Wasserzeichen" type="select" id="pref_fontsize" default="auto"
Expand Down

0 comments on commit fb480b7

Please sign in to comment.