diff --git a/Changelog.txt b/Changelog.txt index b74fc22..a735ed6 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,5 @@ +2019-05-20 + * Oprava prehravani nekterych poradu bez popisu dilu 2019-05-01 * Oprava seznamu poradu 2019-03-14 diff --git a/addon.xml b/addon.xml index ac6e319..dc07152 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/default.py b/default.py index d46c5f3..fbec3f1 100644 --- a/default.py +++ b/default.py @@ -108,8 +108,13 @@ def VIDEOLINK(url,name): # zjisteni nazvu a popisu aktualniho dilu article = doc.find('article', 'b-article b-article-main') + # nazev name = article.find('h3').getText(" ").encode('utf-8') - desc = article.find('div', 'e-description').getText(" ").encode('utf-8') + # popis nemusi byt vzdy uveden + try: + desc = article.find('div', 'e-description').getText(" ").encode('utf-8') + except: + desc = '' # nalezeni iframe main = doc.find('main') @@ -127,10 +132,6 @@ def VIDEOLINK(url,name): thumb = re.compile('').findall(httpdata) thumb = thumb[0] if len(thumb) > 0 else '' - #desc = re.compile('').findall(httpdata) - #desc = desc[0] if len(desc) > 0 else '' - #name = re.compile('').findall(httpdata) - #name = name[0] if len(name) > 0 else '?' renditions = re.compile('renditions: \[(.+?)\]').findall(httpdata) if len(renditions) > 0: @@ -142,7 +143,7 @@ def VIDEOLINK(url,name): for num, url in enumerate(urls): if num < len(renditions): - addLink(renditions[num] + ' - ' + name,url,thumb,desc) + addLink('[B]' + renditions[num] + ' - ' + name + '[/B]',url,thumb,desc) else: addLink(name,url,thumb,desc) else: