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 Mar 19, 2023
1 parent 540a8fe commit 00f5276
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 54 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.6.4+matrix" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.video.ardundzdf" name="ARDundZDF" version="4.6.5+matrix" provider-name="rols1 (rols1@gmx.de)">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.kodi-six" />
Expand Down
4 changes: 2 additions & 2 deletions ardundzdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

# VERSION -> addon.xml aktualisieren
# <nr>90</nr> # Numerierung für Einzelupdate
VERSION = '4.6.4'
VDATE = '16.03.2023'
VERSION = '4.6.5'
VDATE = '19.03.2023'


# (c) 2019 by Roland Scholz, rols1@gmx.de
Expand Down
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ CHANGE HISTORY
max_col 97
--------------

19.03.2023 4.6.5
Audio_get_homescreen (Audiothek): Listeneinträge ohne Titel übersprungen
(z.B. in Entdecken -> Exklusive Podcasts).
LiveRecord (Modul util): popen-Rückmeldung "None args" für LibreElec 11
ergänzt.
arte-Modul: Erweiterung für unterstützte Sprachen - neue Funktion L, neue
Icons arte_Mediathek, arte_lang + arte_live, Anpassungen: Modulkopf, Main_arte,
arte_Search, Kategorien, ArteCluster, home (util), update_single (Modul EPG),
neue Datei ../resources/arte_lang.json, Anpassungen der wichtigsten Fehler-
meldungen, Hinweis auf plugin.video.tyl0re.arte im Haupt-PRG entfernt.

05.02.2023 4.6.4
SingleBeitrag (phoenix): Button ARDundZDF-Suche bei Youtube-Videos ergänzt,
Leitthema-Stil geändert (fett statt rot).
Expand Down
84 changes: 66 additions & 18 deletions resources/arte_lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,28 +187,76 @@
"it": "Torna al menu principale"
},
{
"de": "",
"fr": "",
"en": "",
"es": "",
"pl": "",
"it": ""
"de": "von",
"fr": "de",
"en": "from",
"es": "de",
"pl": "od",
"it": "da"
},
{
"de": "",
"fr": "",
"en": "",
"es": "",
"pl": "",
"it": ""
"de": "bis",
"fr": "à",
"en": "to",
"es": "a",
"pl": "do",
"it": "a"
},
{
"de": "",
"fr": "",
"en": "",
"es": "",
"pl": "",
"it": ""
"de": "LIVE nicht verfügbar für",
"fr": "LIVE non disponible pour",
"en": "LIVE not available for",
"es": "LIVE no disponible para",
"pl": "LIVE nie jest dostępny dla",
"it": "LIVE non disponibile per"
},
{
"de": "Programmabruf fehlgeschlagen",
"fr": "Échec de la récupération du programme",
"en": "Program fetch failed",
"es": "Error en la recuperación del programa",
"pl": "Pobieranie programu nie powiodło się",
"it": "Recupero del programma non riuscito"
},
{
"de": "Fehler in Suche",
"fr": "Erreur dans la recherche",
"en": "Error in search",
"es": "Error en la búsqueda",
"pl": "Błąd w wyszukiwaniu",
"it": "Errore nella ricerca"
},
{
"de": "leider keine Treffer zu",
"fr": "malheureusement aucun résultat pour",
"en": "unfortunately no hits for",
"es": "desafortunadamente no hay resultados para",
"pl": "niestety brak trafień dla",
"it": "purtroppo nessun riscontro per"
},
{
"de": "Fehler in SingleVideo",
"fr": "Erreur dans SingleVideo",
"en": "Error in SingleVideo",
"es": "Error en SingleVideo",
"pl": "Błąd w SingleVideo",
"it": "Errore in SingleVideo"
},
{
"de": "Streams leider (noch) nicht verfügbar",
"fr": "Streams malheureusement pas (encore) disponibles",
"en": "Streams unfortunately not (yet) available",
"es": "Lamentablemente (aún) no hay streams disponibles",
"pl": "Strumienie niestety nie są (jeszcze) dostępne",
"it": "I flussi purtroppo non sono (ancora) disponibili"
},
{
"de": "nicht verfügbar",
"fr": "non disponibl",
"en": "not available!",
"es": "no disponible",
"pl": "niedostępny",
"it": "non disponibile"
},
{
"de": "",
Expand Down
Binary file added resources/images/arte_Mediathek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/arte_lang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/arte_live.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 40 additions & 32 deletions resources/lib/arte.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
################################################################################
# <nr>29</nr> # Numerierung für Einzelupdate
# Stand: 16.03.2023
# Stand: 19.03.2023

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
Expand Down Expand Up @@ -96,7 +96,7 @@ def Main_arte(title='', summ='', descr='',href=''):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, NAME) # Startblank s. home
ltitle = u" %s %s" % (l, NAME) # Startblank s. home
li = home(li, ID=NAME, ltitle=ltitle) # Home-Button


Expand All @@ -112,7 +112,7 @@ def Main_arte(title='', summ='', descr='',href=''):
thumb=R("suche_mv.png"), tagline=tag, fparams=fparams)

title=u"%s Arte-Mediathek" % L(u"Suche in")
tag = "[B]%s[/B]" % arte_lang
tag = u"[B]%s[/B]" % arte_lang
fparams="&fparams={}"
addDir(li=li, label=title, action="dirList", dirID="resources.lib.arte.arte_Search", fanart=R(ICON_ARTE),
thumb=R(ICON_SEARCH), tagline=tag, fparams=fparams)
Expand Down Expand Up @@ -140,7 +140,7 @@ def Main_arte(title='', summ='', descr='',href=''):
# ------------------------------------------------------
title = u"%s" % L(u"Kategorien")
tag = u"%s wwww.arte.tv" % L(u"einschließlich Startseite")
summ = "[B]%s[/B]" % arte_lang
summ = u"[B]%s[/B]" % arte_lang
fparams="&fparams={}"
addDir(li=li, label=title, action="dirList", dirID="resources.lib.arte.Kategorien", fanart=R(ICON_ARTE),
thumb=R(ICON_ARTE), tagline=tag, summary=summ, fparams=fparams)
Expand Down Expand Up @@ -180,10 +180,10 @@ def set_lang(title, new_set=""):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

tag = "[B]%s[/B]" % arte_lang # aktuell
tag = u"[B]%s[/B]" % arte_lang # aktuell
for item in LANG:
title = u"%s --> [B]%s[/B]" % (arte_lang, item)
PLog('Satz6: ' + title)
Expand Down Expand Up @@ -219,7 +219,10 @@ def get_live_data(name):
lang = arte_lang.split("|")[1].strip() # fr, de, ..
path = "https://www.arte.tv/%s/live/" % lang
path, msg = get_page(path, GetOnlyRedirect=True)# Permanent-Redirect bei www.arte.tv/fr/live/
tag_add=""
if url_check(path, dialog=False) == False: # nicht für alle Sprachen verfügbar
tag_add = L(u"LIVE nicht verfügbar für")
tag_add = u"%s: [B]%s[/B]" % (tag_add, arte_lang)
path = "https://www.arte.tv/de/live/" # Fallback

# Format err_par: title, tag, summ, img, href = get_live_data
Expand Down Expand Up @@ -258,6 +261,9 @@ def get_live_data(name):
PLog("title: " + title);
l = L("LAUFENDE SENDUNG")
tag = u"[B]%s: %s - %s [/B]" % (l, start, end)
if tag_add: # nicht verfügbar
tag = u"%s\n%s" % (tag, tag_add)

PLog(title); PLog(thumb); PLog(title);

return title, tag, summ, thumb, href
Expand All @@ -282,15 +288,15 @@ def EPG_Today():
xbmcgui.Dialog().notification(msg1,msg2,icon,3000,sound=True)
path = "https://www.arte.tv/api/rproxy/emac/v3/%s/web/pages/TV_GUIDE/?day=%s" % ("de", today)

page = get_ArtePage('EPG_Today', "EPG_Today", path)
page = get_ArtePage('EPG_Today', "EPG_Today", path)
if page == '':
msg1 = "Programmabruf fehlgeschlagen | %s" % title
MyDialog(msg1, msg, '')
msg1 = L(u"Programmabruf fehlgeschlagen")
MyDialog(msg1, "", '')
return li

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

li, cnt = GetContent(li, page, ID="EPG_Today")
Expand All @@ -307,7 +313,7 @@ def arte_Live(href, title, Plot, img):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

if SETTINGS.getSetting('pref_video_direct') == 'true': # or Merk == 'true' # Sofortstart
Expand Down Expand Up @@ -357,7 +363,7 @@ def arte_Search(query='', nextpage=''):

page, msg = get_page(path=path, do_safe=False) # ohne quote in get_page (api-Call)
if page == '':
msg1 = 'Fehler in Suche: %s' % query
msg1 = L(u'Fehler in Suche') + ": %s" % query
msg2 = msg
MyDialog(msg1, msg2, '')
return li
Expand All @@ -366,7 +372,7 @@ def arte_Search(query='', nextpage=''):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

PLog(len(page))
Expand All @@ -379,7 +385,7 @@ def arte_Search(query='', nextpage=''):
page = json.loads(page)
li,cnt = GetContent(li, page, ID='SEARCH')
if cnt == 0:
msg1 = "leider keine Treffer zu:"
msg1 = L(u"leider keine Treffer zu")
msg2 = query
MyDialog(msg1, msg2, '')
return li
Expand Down Expand Up @@ -511,17 +517,17 @@ def GetContent(li, page, ID):


if mehrfach: # s. coll
tag = u"[B]%s[/B]" % L("Folgebeiträge")
tag = u"[B]%s[/B]" % L(u"Folgebeiträge")
else:
l = L("Dauer")
if start_end:
tag = u"%s %s\n\n%s\n%s" % (l, dur, start_end, geo)
else:
if dur:
tag = u"Dauer %s\n\n%s" % (dur, geo)
tag = u"%s %s\n\n%s" % (l, dur, geo)
else:
tag = u"%s" % (geo)

title = transl_json(title); title = unescape(title);
title = repl_json_chars(title); # franz. Akzent mögl.
summ = repl_json_chars(summ) # -"-
Expand Down Expand Up @@ -554,9 +560,11 @@ def GetContent(li, page, ID):

label = title
if ID == "EPG_Today": # EPG: Uhrzeit -> Label
lvon = L("von"); lbis = L("bis")
ldauer = L("Dauer")
start = start[-5:]; end = end[-5:];
label = "[COLOR blue]%s[/COLOR] | %s" % (start, title) # Sendezeit | Titel
tag = "[B]von %s bis %s Uhr | Dauer: %s [/B]" % (start, end, dur)
tag = "[B]%s %s %s %s Uhr | %s: %s [/B]" % (lvon, start, lbis, end, ldauer, dur)
if "stickers" in item:
try:
if item["stickers"][0]["code"] == "LIVE":
Expand Down Expand Up @@ -653,7 +661,7 @@ def Beitrag_Liste(url, title):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

ID='Beitrag_Liste'
Expand Down Expand Up @@ -712,7 +720,7 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):

page, msg = get_page(path1, JsonPage=True, do_safe=False) # api_v2_Call
if page == '':
msg1 = 'Fehler in SingleVideo: %s' % title
msg1 = L(u'Fehler in SingleVideo') + ": %s" % title
msg2 = msg
MyDialog(msg1, msg2, '')
return li
Expand Down Expand Up @@ -762,7 +770,7 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):

if not len(HLS_List) and not len(MP4_List):
msg1 = u'SingleVideo: [B]%s[/B]' % title
msg2 = u'Streams leider (noch) nicht verfügbar.'
msg2 = L(u'Streams leider (noch) nicht verfügbar')
MyDialog(msg1, msg2, '')
return li

Expand All @@ -779,7 +787,7 @@ def SingleVideo(img, title, pid, tag, summ, dur, geo, trailer=''):

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

if hls_add: # Trailer-Zusatz
Expand Down Expand Up @@ -966,7 +974,7 @@ def Kategorien():

li = xbmcgui.ListItem()
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

# Format: Titel-deutsch | Icon | Kat_ID | verfügbar für Sprache
Expand Down Expand Up @@ -1028,7 +1036,7 @@ def Kategorien():

title = L("Neueste Videos") # Button Neueste Videos
path = "https://www.arte.tv/api/rproxy/emac/v4/%s/web/zones/daeadc71-4306-411a-8590-1c1f484ef5aa/content?abv=A&page=1&pageId=MOST_RECENT&zoneIndexInPage=0" % lang
path=py2_encode(path)
title=py2_encode(title); path=py2_encode(path);
fparams="&fparams={'title': '%s', 'url': '%s'}" %\
(quote(title), quote(path))
addDir(li=li, label=title, action="dirList", dirID="resources.lib.arte.Beitrag_Liste", fanart=R(ICON_ARTE),
Expand Down Expand Up @@ -1091,7 +1099,7 @@ def ArteCluster(pid='', title='', katurl=''):
PLog('ArteStart_1:')
PLog(str(values)[:100])
l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button

if ping_uhd and lang == "de": # UHD-Button
Expand Down Expand Up @@ -1156,7 +1164,7 @@ def ArteCluster(pid='', title='', katurl=''):
PLog(str(page)[:80])

l = L(u'Zurück zum Hauptmenü')
ltitle = " %s %s" % (l, "arte") # Startblank s. home
ltitle = u" %s %s" % (l, "arte") # Startblank s. home
li = home(li, ID='arte', ltitle=ltitle) # Home-Button
li, cnt = GetContent(li, page, ID="ArteStart_2")
PLog("cnt: " + str(cnt))
Expand Down Expand Up @@ -1222,11 +1230,11 @@ def get_ArtePage(caller, title, path, header=''):

page, msg = get_page(path, GetOnlyRedirect=True)# Permanent-Redirect-Url abfangen
url = page
page, msg = get_page(url, header=header)
page, msg = get_page(url, header=header)
if page == '':
msg1 = 'Fehler in %s: %s' % (caller, title)
msg1 = u"%s: " % caller + L("nicht verfügbar") + ":"
msg2 = title
msg2 = msg
msg2 = u"Seite weder im Cache noch im Web verfügbar"
MyDialog(msg1, msg2, '')
return ''

Expand Down Expand Up @@ -1296,7 +1304,8 @@ def L(string):
lang = arte_lang.split("|")[1].strip() # fr, de, ..
PLog("lang: " + arte_lang)

fname = os.path.join("%sresources/arte_lang.json") % ADDON_PATH
# erstes / für Leia erforderlich:
fname = os.path.join("%s/resources/arte_lang.json") % ADDON_PATH
if os.path.exists(fname) == False:
PLog("fehlt: %s" % fname)
return string
Expand All @@ -1314,9 +1323,8 @@ def L(string):
break
except Exception as exception:
PLog("L_error: " + str(exception))
# lstring=""

PLog("lstring: " + lstring)
PLog("lstring_found: %s" % lstring)
if lstring:
return lstring
else:
Expand Down
Loading

0 comments on commit 00f5276

Please sign in to comment.