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 Jul 2, 2022
1 parent 90c31ba commit b776731
Show file tree
Hide file tree
Showing 9 changed files with 333 additions and 51 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.4.2+matrix" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.video.ardundzdf" name="ARDundZDF" version="4.4.3+matrix" provider-name="rols1 (rols1@gmx.de)">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.kodi-six" />
Expand Down
111 changes: 98 additions & 13 deletions ardundzdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

# VERSION -> addon.xml aktualisieren
# <nr>60</nr> # Numerierung für Einzelupdate
VERSION = '4.4.2'
VDATE = '27.06.2022'
VERSION = '4.4.3'
VDATE = '02.07.2022'


# (c) 2019 by Roland Scholz, rols1@gmx.de
Expand Down Expand Up @@ -5727,19 +5727,43 @@ def SenderLiveListe(title, listname, fanart, offset=0, onlySender=''):
ard_streamlinks = get_ARDstreamlinks() # ard_streamlinks oder ard_streamlinks_UT
iptv_streamlinks = get_IPTVstreamlinks() # private + einige regionale

# abweichend - externe Funktion:
if u'Regional: WDR' in lname: # Auswertung + Liste WDR Lokalzeit
url = "https://www1.wdr.de/fernsehen/livestream/lokalzeit-livestream/index.html"
wdr_streamlinks = list_WDRstreamlinks(url) # Webseite
return

mediatype='' # Kennz. Video für Sofortstart
if SETTINGS.getSetting('pref_video_direct') == 'true':
if "Audio Event" in title: # ARD Audio Event Streams (ARDSportAudioXML:)
mediatype='music'
else:
mediatype='video'

# abweichend - externe Funktion:
if u'Regional: WDR' in lname: # Auswertung + Liste WDR Lokalzeit
url = "https://www1.wdr.de/fernsehen/livestream/lokalzeit-livestream/index.html"
wdr_streamlinks = list_WDRstreamlinks(url) # Webseite
return

# Zusatzbutton:
if u'Privat' in listname: # Suchfunktion IPTV-Private
title = u"Suche lokale private IPTV-Sender"
img = R("suche_iptv.png")
tag = "Quelle: [B]kodi_tv_local.m3u[/B] im jnk22-Repo auf Github"
summ = "der zuletzt gefundene IPTV-Sender wird unter diesem Suchbutton eingeblendet."
title=py2_encode(title)
fparams="&fparams={'title': '%s'}" % (quote(title))
addDir(li=li, label=title, action="dirList", dirID="SenderLiveSearch", fanart=img, thumb=img,
fparams=fparams, tagline=tag, summary=summ)

iptv_search = Dict("load", "iptv_search") # letztes Suchergebnis -> Senderbutton
if iptv_search:
tvgname,tvgid,thumb,link = iptv_search.splitlines()
title=py2_encode(tvgname); link=py2_encode(link);
thumb=py2_encode(thumb);
title = "Suchergebnis: [B]%s[/B]" % tvgname
summ = "zuletzt gefundener IPTV-Sender: [B]%s[/B]" % tvgname
fparams="&fparams={'path': '%s', 'thumb': '%s', 'title': '%s', 'descr': ''}" % (quote(link),
quote(thumb), quote(title))
addDir(li=li, label=title, action="dirList", dirID="SenderLiveResolution", fanart=R("suche_iptv.png"),
thumb=thumb, fparams=fparams, tagline=tag, summary=summ, mediatype=mediatype)


liste = blockextract('<item>', mylist) # Details eines Senders
PLog(len(liste));
EPG_ID_old = '' # Doppler-Erkennung
Expand Down Expand Up @@ -5876,6 +5900,61 @@ def SenderLiveListe(title, listname, fanart, offset=0, onlySender=''):
# https://github.com/asciidisco/plugin.video.netflix/issues/576 aber Fix hier nicht anwendbar.
xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=True)

#-----------------------------------------------
# Suche nach IPTV-Livesendern - bisher nur lokale private Sender
# aus jnk22-Repo - s. Zusatzbutton SenderLiveListe
def SenderLiveSearch(title):
PLog('SenderLiveSearch:')

query = get_keyboard_input()
if query == None or query.strip() == '': # None bei Abbruch
return SenderLiveListe("", "","") # dummy, sonst Absturz nach Sofortstart/Suche
query = query.strip()
PLog(query)

url = "https://raw.githubusercontent.com/jnk22/kodinerds-iptv/master/iptv/kodi/kodi_tv_local.m3u"
page, msg = get_page(url)
if page == '':
msg1 = "Fehler in get_WRDstreamlinks:"
msg2=msg
MyDialog(msg1, msg2, '')
return
PLog(page[:60])

li = xbmcgui.ListItem()
li = home(li, ID=NAME) # Home-Button

mediatype='' # Kennz. Video für Sofortstart
if SETTINGS.getSetting('pref_video_direct') == 'true':
mediatype='video'

items = blockextract('#EXTINF:', page)
for item in items:
if up_low(query) in up_low(item):
tag=""
tvgname = stringextract('tvg-name="', '"', item)
tvgid = stringextract('tvg-id="', '"', item)
thumb = stringextract('tvg-logo="', '"', item)
links = blockextract('https', item) # 1. logo, 2. streamlink
link = links[-1]
tvgname = py2_decode(tvgname); tvgid = py2_decode(tvgid)
if tvgid:
tag = "tvg-id: [B]%S[/B]" % tvgid
PLog(tvgname); PLog(tvgid); PLog(thumb); PLog(link);
iptv_search = "%s\n%s\n%s\n%s" % (tvgname,tvgid,thumb,link)
Dict("store", "iptv_search", iptv_search)

title=py2_encode(tvgname); link=py2_encode(link);
thumb=py2_encode(thumb);
fparams="&fparams={'path': '%s', 'thumb': '%s', 'title': '%s', 'descr': ''}" % (quote(link),
quote(thumb), quote(title))
addDir(li=li, label=title, action="dirList", dirID="SenderLiveResolution", fanart=R("suche_iptv.png"),
thumb=thumb, fparams=fparams, tagline=tag, mediatype=mediatype)

break

xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=True)

#-----------------------------------------------
# WRD-Links
# Aufruf SenderLiveListe für WDR Lokalzeit
Expand Down Expand Up @@ -5910,13 +5989,15 @@ def list_WDRstreamlinks(url):
img_src = stringextract('alt="', 'src=', item)
img_src = stringextract('title="', '"', img_src) # alt-title
summ = img_src
summ = "%s\n\n[B]Sendezeit 19.30 - 20.00 Uhr[/B]" % summ
summ = u"%s\n\n[B]Sendezeit 19.30 - 20.00 Uhr[/B]" % summ
summ_par = summ.replace('\n', '||')

PLog("Satz28:")

PLog(path);PLog(img); PLog(title); PLog(summ);
title=py2_encode(title); summ=py2_encode(summ)
title=py2_encode(title); summ_par=py2_encode(summ_par)
path=py2_encode(path); img=py2_encode(img);

fparams="&fparams={'path': '%s', 'title': '%s', 'img': '%s', 'summ': '%s'}" %\
(quote(path), quote(title), quote(img), quote(summ_par))
addDir(li=li, label=title, action="dirList", dirID="WDRstream", fanart=img, thumb=img,
Expand Down Expand Up @@ -7826,6 +7907,9 @@ def ZDFRubrikSingle(title, path, clus_title='', page='', ID='', custom_cluster='
teaserDetails='done' # Flag für get_summary_pre
# multi z.Z. nicht verwendet, isvideo reicht aus
teaser_label,teaser_typ,teaser_nr,teaser_brand,teaser_count,multi = ZDF_get_teaserbox(rec)
if teaser_label and teaser_typ: # Doppel möglich
if teaser_typ.strip() in teaser_label.strip():
teaser_typ=""

PLog("isvideo: %s, dauer: %s, enddate: %s" % (isvideo, dauer, enddate))
if isvideo or dauer or enddate: # enddate ohne dauer möglich
Expand Down Expand Up @@ -7873,7 +7957,7 @@ def ZDFRubrikSingle(title, path, clus_title='', page='', ID='', custom_cluster='
title = repl_json_chars(py2_decode(title));
descr = repl_json_chars(descr)
if tag:
descr = "%s\n\n%s" % (tag, descr)
descr = u"%s\n\n%s" % (tag, descr)
descr_par = descr.replace('\n', '||')

if '>Jetzt live</h2>' in rec: # Livestream-Satz?
Expand Down Expand Up @@ -8256,7 +8340,7 @@ def ZDF_get_teaserbox(page):
PLog('teaser_typ: ' + teaser_typ)
teaser_label = cleanhtml(teaser_label.strip()) # wird ev. -> title
teaser_label = unescape(teaser_label);
teaser_typ = mystrip(teaser_typ.strip())
teaser_typ = mystrip(teaser_typ.strip())

if u"teaser-episode-number" in page:
teaser_nr = stringextract('teaser-episode-number">', '</', page)
Expand Down Expand Up @@ -8289,6 +8373,7 @@ def ZDF_get_teaserbox(page):
teaser_label = mystrip(teaser_label)
teaser_label = teaser_label.replace('<div class="ellipsis">', ' ')
teaser_label = (teaser_label.replace('<strong>', '').replace('</strong>', ''))
PLog(teaser_label); PLog(teaser_typ);

PLog('teaser_label: %s,teaser_typ: %s, teaser_nr: %s, teaser_brand: %s, teaser_count: %s, multi: %s' %\
(teaser_label,teaser_typ,teaser_nr,teaser_brand,teaser_count, multi))
Expand Down Expand Up @@ -10308,7 +10393,7 @@ def StreamsShow(title, Plot, img, geoblock, ID, sub_path='', HOME_ID="ZDF"):
li = home(li, ID=HOME_ID) # Home-Button

Stream_List = Dict("load", ID)
PLog(Stream_List)
#PLog(Stream_List)
PLog(len(Stream_List))

# bei Kennzeichnung einz. Stream mit unbekannt keine Sortierung
Expand Down
23 changes: 23 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ CHANGE HISTORY
max_col 97
--------------

02.07.2022 4.4.3
Suchwortliste (ARD+ZDF): Erweiterung mit Tool-Funktionen zeigen/löschen/
hinzufügen, neue Funktionen: SearchWordTools + SearchWordWork, Anpassung
InfoAndFilter.
neues Modul tools: Verlagerung aus Haupt-PRG -> tools: SearchWordTools +
SearchWordWork, FilterTools + FilterToolsWork.
Addon-Infos: Suchwortliste in Kategorie Pfade aufgenommen, Titel fett
markiert.
Kontextmenü Ausschlussfilter: Beschränkung auf Hauptmenüs aufgehoben,
Anpassung in home + addDir.
home (Modul util): aktive Filter im Infobereich ergänzt (für Homebutton
ARD, ZDF, Audiothek).
update_single (Modul EPG): Installation neuer Module aus Github-Repo
ergänzt.
get_IPTVstreamlinks (Modul util): Fix codec-error Leia (py2_decode für
play_sender und tvg_name.
list_WDRstreamlinks: py2_encode für summ_par (Fix codec-error Leia).
ZDFRubrikSingle: Doppel im Info-Bereich entfernt (teaser_typ und teaser_label).
ARDStart (ARDnew): Auswertung neue Rubrik "Unsere Region", neue Funktion
ARDStartRegion.
SenderLiveListe: Zusatzbutton "Suche lokale private IPTV-Sender" plus Button
für zuletzt gefundenen Sender, neue Funktion SenderLiveSearch.

25.06.2022 4.4.2
Sportschau.de: Codebereinigung mit ARDSportLoadPage für ARDSportCluster,
Nachbesserungen in ARDAudioEventStreams, ARDSportWDR, ARDSportHub (neu),
Expand Down
Binary file modified resources/images/icon-filter.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/icon_searchwords.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/suche_iptv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 114 additions & 1 deletion resources/lib/ARDnew.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def Main_NEW(name='', CurSender=''):
# Problem Stringauswertung: die ersten 4 Container folgen doppelt (bei jedem Sender) - Abhilfe:
# Abgleich mit Titelliste. Wg. Performance Verzicht auf json-/key-Auswertung.
# 30.09.2021 Sonderbehdl. spaltenübergreifender Titel mit Breitbild (Auswert. descr, skip Bild)
# 29.06.2022 Abzweig ARDStartRegion für neuen Cluster "Unsere Region"
#
def ARDStart(title, sender, widgetID='', path=''):
PLog('ARDStart:');
Expand Down Expand Up @@ -329,11 +330,21 @@ def ARDStart(title, sender, widgetID='', path=''):
ID = 'ARDStart'

PLog('Satz_cont1:');
func = "ARDStartRubrik" # Default-Funktion
if "Unsere Region" in title:
items = Dict("load", 'ARD_REGION')
rname = "Berlin"; partner = "rbb"
if "|" in str(items):
region,rname,partner = items.split("|")
tag = u"aktuelle Region: [B]%s[/B]" % rname
summ = u"Partnersender: [B]%s[/B]" % partner
func = "ARDStartRegion" # neu ab 29.06.2022

PLog(title); PLog(ID); PLog(anz); PLog(img);
path=py2_encode(path); title=py2_encode(title);
fparams="&fparams={'path': '%s', 'title': '%s', 'widgetID': '', 'ID': '%s'}" %\
(quote(path), quote(title), ID)
addDir(li=li, label=title, action="dirList", dirID="resources.lib.ARDnew.ARDStartRubrik", fanart=img, thumb=img,
addDir(li=li, label=title, action="dirList", dirID="resources.lib.ARDnew.%s" % func, fanart=img, thumb=img,
tagline=tag, summary=summ, fparams=fparams)


Expand Down Expand Up @@ -436,6 +447,108 @@ def ARDRubriken(li, page):
return

###################################################
#---------------------------------------------------------------------------------------------------
# 29.06.2022 Auswertung Cluster "Unsere Region"
# Default-Region: Berlin (wie Web), ID=change: Wechsel
# widgetID transportiert hier region-Triple (Bsp. be|Berlin|rbb)
#
def ARDStartRegion(path, title, widgetID='', ID=''):
PLog('ARDStartRegion:')
PLog(widgetID)
PLog(ID)
title_org = title
base = "https://api.ardmediathek.de/page-gateway/widgets/"

if widgetID: # frisch gewechselt
region,rname,partner = widgetID.split("|")
Dict("store", 'ARD_REGION', "%s|%s|%s" % (region,rname,partner))
else:
region=""; rname=""; partner="";
page = Dict("load", 'ARD_REGION')
try:
region,rname,partner = page.split("|")
except Exception as exception:
PLog(str(exception))
if region == "": # Default-Region
region="be"; rname="Berlin"; partner="rbb"


path = base + "ard/region/6YgzSO0C7huVaGgzM5mq19/%s?pageNumber=0&pageSize=100" % region
page, msg = get_page(path=path)
if page == '':
msg1 = "Fehler in ARDStartRegion: %s" % title
msg2 = msg
MyDialog(msg1, msg2, '')
return

li = xbmcgui.ListItem()
li = home(li, ID='ARD Neu') # Home-Button
regions = stringextract('regions":', '"links"', page)
PLog(len(regions))
#------------------------ # Änderungsliste Region
if "change" in ID:
PLog("do_change:")
PLog(regions[:60])
img = R(ICON_DIR_FOLDER)
items = blockextract('"id"', regions)
for item in items:
region = stringextract('id":"', '"', item)
rname = stringextract('name":"', '"', item)
partner = stringextract('partner":"', '"', item)

widgetID = "%s|%s|%s" % (region,rname,partner)
title = u"Region: [B]%s[/B]" % rname
tag = u"Partnersender: [B]%s[/B]" % partner

title=py2_encode(title); widgetID=py2_encode(widgetID);
fparams="&fparams={'path': '', 'title': '%s', 'widgetID': '%s', 'ID': ''}" %\
(quote(title), quote(widgetID))
addDir(li=li, label=title, action="dirList", dirID="resources.lib.ARDnew.ARDStartRegion",
fanart=img, thumb=img, tagline=tag, fparams=fparams)

xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=True)
return

#------------------------ # Auswertung Region
PLog("do_region:")
ID = "ARDStartRubrik"
mark=''
li = get_page_content(li, page, ID, mark) # Auswertung Rubriken + Live-/Eventstreams
icon = R(ICON_DIR_FOLDER)
img = icon
msg1 = "Region"
msg2 = rname # Dateiname bei ARD neu nichtssagend
xbmcgui.Dialog().notification(msg1,msg2,icon,2000, sound=False)


if '"pagination":' in page: # Scroll-Beiträge
PLog('pagination_Rubrik:')
title = "Mehr zu >%s<" % title_org # Mehr-Button
li = xbmcgui.ListItem() # Kontext-Doppel verhindern
pages, pN, pageSize, totalElements, next_path = get_pagination(page) # Basis 0

if next_path:
summ = u"insgesamt: %s Seite(n) , %s Beiträge" % (pages, totalElements)
pN = int(pN)+1 # nächste pageNumber, Basis 0
tag = "weiter zu Seite %s" % str(pN)
PLog(summ); PLog(next_path)

title_org=py2_encode(title_org); next_path=py2_encode(next_path); mark=py2_encode(mark);
fparams="&fparams={'title': '%s', 'path': '%s', 'pageNumber': '%s', 'pageSize': '%s', 'ID': '%s', \
'mark': '%s'}" % (quote(title_org), quote(next_path), str(pN), pageSize, ID, quote(mark))
addDir(li=li, label=title, action="dirList", dirID="resources.lib.ARDnew.ARDPagination",
fanart=R(ICON_MEHR), thumb=R(ICON_MEHR), summary=summ, tagline=tag, fparams=fparams)

label = u"Region ändern"
tag = u"aktuelle Region: [B]%s[/B]" % rname
path=py2_encode(path); title=py2_encode(title);
fparams="&fparams={'path': '%s', 'title': '%s', 'ID': 'change'}" %\
(quote(path), quote(title_org))
addDir(li=li, label=label, action="dirList", dirID="resources.lib.ARDnew.ARDStartRegion",
fanart=img, thumb=img, tagline=tag, fparams=fparams)

xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=True)


#---------------------------------------------------------------------------------------------------
# Auflistung einer Rubrik aus ARDStart - geladen wird das json-Segment für die Rubrik, z.B.
Expand Down
Loading

0 comments on commit b776731

Please sign in to comment.