Skip to content

Commit

Permalink
Oprava #29 a #30. (#31)
Browse files Browse the repository at this point in the history
* Oprava přehrávání pořadů s odkazem na speciální stránku

* Oprava zobrazeni dalsich dilu po zmene stranek Nova Plus

* Zapomenutý pokus
  • Loading branch information
elring authored and lzoubek committed Nov 23, 2019
1 parent 04cdb7b commit ceff870
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2019-11-23
* Oprava prehravani poradu s odkazem na specialni stranku poradu
* Oprava zobrazeni dalsich dilu po zmene stranek Nova Plus
2019-05-20
* Oprava prehravani nekterych poradu bez popisu dilu
2019-05-01
Expand Down
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.dmd-czech.novaplus"
name="Nova Plus TV Archiv"
version="1.0.18"
version="1.0.19"
provider-name="Jiri Vyhnalek">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
32 changes: 26 additions & 6 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def CATEGORIES(url,page):
if article.a is not None:
url = article.a['href'].encode('utf-8')
title = article.a['title'].encode('utf-8')
#title = article.a['title'].encode('utf-8') + ' ' + str(url)
thumb = article.a.div.img['data-original'].encode('utf-8')
addDir(title,url,2,thumb,1)

Expand All @@ -106,11 +107,30 @@ def VIDEOLINK(url,name):

doc = read_page(url)

# zjisteni nazvu a popisu aktualniho dilu
# nalezeni hlavniho article
article = doc.find('article', 'b-article b-article-main')

# pokud hlavni article neexistuje, jsme na specialni strance a prejdeme na odkaz "Cele dily"
if article is None:
nav = doc.find('nav', 'sub-nav')
if nav != None and nav.ul != None:
for li in nav.ul.findAll('li'):
if li.a != None and li.a['title'] != None and li.a['title'].encode('utf-8') == 'Celé díly':
url = li.a['href']
doc = read_page(url)
article = doc.find('article', 'b-article b-article-main')

# pokud stale hlavni article neexistuje, chyba
if article is None:
xbmcgui.Dialog().ok("Nova Plus TV Archiv", "Na stránce nenalezena sekce s videi. Program nebude fungovat správně.", url)

# nazev
name = article.find('h3').getText(" ").encode('utf-8')
# popis nemusi byt vzdy uveden
try:
name = article.find('h3').getText(" ").encode('utf-8')
except:
name = 'Jméno pořadu nenalezeno';

# popis (nemusi byt vzdy uveden)
try:
desc = article.find('div', 'e-description').getText(" ").encode('utf-8')
except:
Expand All @@ -135,7 +155,7 @@ def VIDEOLINK(url,name):

renditions = re.compile('renditions: \[(.+?)\]').findall(httpdata)
if len(renditions) > 0:
renditions = re.compile('[\'\:](.+?)[\'\:]').findall(renditions[0])
renditions = re.compile('[\"](.+?)[\"]').findall(renditions[0])

bitrates = re.compile('src = {(.+?)\[(.+?)\]').findall(httpdata);
if len(bitrates) > 0:
Expand All @@ -150,10 +170,10 @@ def VIDEOLINK(url,name):
xbmcgui.Dialog().ok('Chyba', 'Video nelze přehrát', '', '')

# dalsi dily poradu
for article in doc.findAll('article', 'b-article b-article-no-labels'):
for article in doc.findAll('article', 'b-article-news'):
url = article.a['href'].encode('utf-8')
title = article.a['title'].encode('utf-8')
thumb = article.a.div.img['data-original'].encode('utf-8')
thumb = article.a.img['data-original'].encode('utf-8')
addDir(title,url,3,thumb,1)

def get_params():
Expand Down

0 comments on commit ceff870

Please sign in to comment.