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 Apr 13, 2024
1 parent 040ef49 commit c11d322
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 23 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="5.0.0+nexus" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.video.ardundzdf" name="ARDundZDF" version="5.0.1+nexus" provider-name="rols1 (rols1@gmx.de)">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.kodi-six" />
Expand Down
13 changes: 6 additions & 7 deletions ardundzdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

# VERSION -> addon.xml aktualisieren
# <nr>190</nr> # Numerierung für Einzelupdate
VERSION = '5.0.0'
VDATE = '03.04.2024'
VERSION = '5.0.1'
VDATE = '13.04.2024'


# (c) 2019 by Roland Scholz, rols1@gmx.de
Expand Down Expand Up @@ -1766,8 +1766,6 @@ def AudioSenderPrograms(org=''):
xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=True)

#---------------------------------
RSave('/tmp/x_ARD.json', py2_encode(LiveObjekts[0])) # Debug


if org: # 2. Durchlauf: programSets listen
PLog("stage2: " + org)
Expand Down Expand Up @@ -10039,6 +10037,7 @@ def build_Streamlists_buttons(li,title_org,thumb,geoblock,Plot,sub_path,\
if geoblock and geoblock not in Plot:
Plot = "%s||%s" % (Plot, geoblock)

title_org=repl_json_chars(title_org)
tagline = Plot.replace('||', '\n')
Plot = Plot.replace('\n', '||')

Expand Down Expand Up @@ -10814,7 +10813,7 @@ def StreamsShow(title, Plot, img, geoblock, ID, sub_path='', HOME_ID="ZDF"):
if u"Auflösung" in str(Stream_List):
Stream_List = sorted(Stream_List,key=lambda x: int(re.search(u'sung (\d+)x', x).group(1)))
except Exception as exception: # bei HLS/"auto", problemlos da vorsortiert durch Sender
PLog("sort_error" + str(exception))
PLog("sort_error: " + str(exception))

title_org=py2_encode(title_org); img=py2_encode(img);
sub_path=py2_encode(sub_path); Plot=py2_encode(Plot);
Expand Down Expand Up @@ -10875,12 +10874,12 @@ def router(paramstring):
# paramstring: Dictionary mit
# {<parameter>: <value>} Elementen
paramstring = unquote_plus(paramstring)
PLog(' router_params1: ' + paramstring)
# PLog(' router_params1: ' + paramstring)
PLog(type(paramstring));

if paramstring:
params = dict(parse_qs(paramstring[1:]))
PLog(' router_params_dict: ' + str(params))
# PLog(' router_params_dict: ' + str(params))
try:
if 'content_type' in params:
if params['content_type'] == 'video': # Auswahl im Addon-Menü
Expand Down
15 changes: 15 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ CHANGE HISTORY
max_col 97
--------------

13.04.2024 5.0.1
Suche in Audiothek: Verwendung des Web-api zur Angleichung der Ergebnisse,
Anpassung AudioSearch (Param. base), AudioSearch_cluster (pageProps, totalCount,
api_url -> search_url), Audio_get_search_cluster (Audio_get_nexturl entfällt),
neue Funktion my_jsondump.
SendungenAZ (my3Sat): unescape Param. rubrik.
get_streams_api_opa (arte): Escapezeichen in Url-HBBTV-Quellen bei api/opa/v3
entfernt.
ARDStartSingle: Umstellung Untertitel auf vtt-Format (statt xml), bei Fehlen
von UT Suche in alternativer Web-api-Quelle (frühzeitig verfügbar, relevant
für Nachrichten), neue Funktion ARDStartVideoWebUTget.
sub_path_conv (util): aktuelle ARD-vtt-Datei mit W3-Style-Definitionen ergänzt.
build_Streamlists_buttons: repl_json_chars(title_org), um sort_error wegen
#-Zeichen in StreamsShow zu vermeiden.

31.03.2024 5.0.0
ZDF_PageMenu: CacheTime für DictID (30 min), um Aktualisierung bei Favoriten
und Merkliste sicherzustellen, ergänzt mit url i.V.m. jsonpath zum Nachladen
Expand Down
41 changes: 41 additions & 0 deletions resources/UT_Styles_ARD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
WEBVTT

STYLE
::cue(.textWhite) {
color: white;
}

STYLE
::cue(.textBlack) {
color: black;
}

STYLE
::cue(.textRed) {
color: red;
}

STYLE
::cue(.textGreen) {
color: green;
}

STYLE
::cue(.textYellow) {
color: yellow;
}

STYLE
::cue(.textMagenta) {
color: magenta;
}

STYLE
::cue(.textBlue) {
color: blue;
}

STYLE
::cue(.textCyan) {
color: cyan;
}
4 changes: 2 additions & 2 deletions resources/lib/my3Sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
################################################################################
# <nr>16</nr> # Numerierung für Einzelupdate
# Stand: 13.03.2024
# Stand: 04.04.2024

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -327,7 +327,7 @@ def SendungenAZ(name, path):
href = stringextract('href="', '"', tlink)
href = DreiSat_BASE + href
descr = stringextract('clickarea-link" >', '<', rec)
tag = rubrik
tag = unescape(rubrik)
if sub_rubrik:
tag = "%s | %s" % (tag, sub_rubrik)
tag = cleanhtml(tag)
Expand Down
39 changes: 26 additions & 13 deletions resources/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3796,21 +3796,34 @@ def monitor_resume(player, new_list, video_dur, seekTime):
#
def sub_path_conv(sub_path):
PLog("sub_path_conv:")
sub_path_org=sub_path

sub_list=[]
if 'ardmediathek.de' in sub_path or 'tagesschau.de' in sub_path:
if sub_path.endswith(".vtt") == False: # .vtt-Format ohne Konvertierung
# ARD-Untertitel speichern
local_path = "%s/%s" % (SUBTITLESTORE, sub_path.split('/')[-1])
local_path = os.path.abspath(local_path)
local_path = local_path.replace(':', '_')# Bsp. ../subtitles/urn:ard:subtitle:..
try:
urlretrieve(sub_path, local_path)
except Exception as exception:
PLog(str(exception))
local_path = ''
if local_path: # util: Konvert. für Kodi leer bei Fehlschlag,
sub_path = xml2srt(local_path) # Endung .srt, falls erfolgreich
# ARD-Untertitel speichern
local_path = "%s/%s" % (SUBTITLESTORE, sub_path.split('/')[-1])
local_path = os.path.abspath(local_path)
local_path = local_path.replace(':', '_')# Bsp. ../subtitles/urn:ard:subtitle:..
try:
urlretrieve(sub_path, local_path)
except Exception as exception:
PLog(str(exception))
local_path = ''
if local_path:
if sub_path.endswith(".vtt") == False: # .vtt-Format ohne Konvertierung
sub_path = xml2srt(local_path) # Konvertierung, Endung .srt, falls erfolgreich
else: # .vtt-Datei mit Styles ergänzen
try:
styles_path = '%s/resources/%s' % (ADDON_PATH, "UT_Styles_ARD")
styles = RLoad(styles_path, abs_path=True)
if styles == "": # Ladeproblem?
styles = "WEBVTT"
vtt = RLoad(local_path, abs_path=True)
vtt = vtt.replace("WEBVTT", styles) # WEBVTT durch Styles-Defs ersetzen
RSave(local_path, py2_encode(vtt), withcodec=False)
except Exception as exception:
PLog("styles_error: " + str(exception))
sub_path = local_path # ohne Styles bei Exception

sub_list.append(sub_path) # subtitleFiles: tuple or list
if PYTHON3:
Expand All @@ -3821,7 +3834,7 @@ def sub_path_conv(sub_path):
else: # != ARD, ZDF
sub_list.append(sub_path)

PLog("sub_path_conv: " + str(sub_list))
PLog("sub_path_conv_end: " + str(sub_list))
return sub_list

#----------------------------------------------------------------
Expand Down

0 comments on commit c11d322

Please sign in to comment.