Merge branch 'master' of git://github.com/kodiondemand/addon into kodiondemand-master

This commit is contained in:
greko
2019-05-27 00:40:10 +02:00
6 changed files with 130 additions and 380 deletions
+34 -4
View File
@@ -141,7 +141,11 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
matches = scrapertoolsV2.find_multiple_matches(block, patron)
log('MATCHES =', matches)
<<<<<<< HEAD
known_keys = ['url', 'title', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'lang']
=======
known_keys = ['url', 'title', 'title2', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type'] #by greko aggiunto episode
>>>>>>> 69c3700f279e8bc0c0741982c8c26b045549ffc6
for match in matches:
if len(listGroups) > len(match): # to fix a bug
match = list(match)
@@ -157,6 +161,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).replace('"', "'").strip() # fix by greko da " a '
plot = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["plot"]))
<<<<<<< HEAD
longtitle = '[B]' + title + '[/B] '
if scraped["quality"]:
longtitle += '[COLOR blue][' + scraped["quality"] + '][/COLOR]'
@@ -168,6 +173,16 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
else:
lang = 'ITA'
longtitle += '[COLOR blue][' + lang + '][/COLOR]'
=======
longtitle = typo(title, 'bold')
if scraped['quality']: longtitle = longtitle + typo(scraped['quality'], '_ [] color kod')
if scraped['episode']:
scraped['episode'] = re.sub(r'\s-\s|-|x|&#8211', 'x' , scraped['episode'])
longtitle = typo(scraped['episode'] + ' - ', 'bold') + longtitle
if scraped['title2']:
title2 = scrapertoolsV2.decodeHtmlentities(scraped["title2"]).strip()
longtitle = longtitle + typo(title2, 'bold _ -- _')
>>>>>>> 69c3700f279e8bc0c0741982c8c26b045549ffc6
if item.infoLabels["title"] or item.fulltitle: # if title is set, probably this is a list of episodes or video sources
infolabels = item.infoLabels
@@ -497,15 +512,29 @@ def nextPage(itemlist, item, data, patron, function_level=1):
return itemlist
def server(item, data='', headers='', AutoPlay=True, CheckLinks=True):
def pagination(itemlist, item, page, perpage, function_level=1):
if len(itemlist) >= page * perpage:
itemlist.append(
Item(channel=item.channel,
action=inspect.stack()[function_level][3],
contentType=item.contentType,
title=typo(config.get_localized_string(30992), 'color kod bold'),
url=item.url,
args=item.args,
page=page + 1,
thumbnail=thumb()))
return itemlist
def server(item, data='', itemlist='', headers='', AutoPlay=True, CheckLinks=True):
if not data:
data = httptools.downloadpage(item.url, headers=headers).data
itemlist = servertools.find_video_items(data=str(data))
if not itemlist:
itemlist = servertools.find_video_items(data=str(data))
for videoitem in itemlist:
videoitem.title = "".join([item.title, ' ', typo(videoitem.title, 'color kod []')])
videoitem.title = "".join([item.title, ' ', typo(videoitem.title, 'color kod []'), typo(videoitem.quality, 'color kod []') if videoitem.quality else ""])
videoitem.fulltitle = item.fulltitle
videoitem.show = item.show
videoitem.thumbnail = item.thumbnail
@@ -535,6 +564,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True):
if AutoPlay == True:
autoplay.start(itemlist, item)
videolibrary(itemlist, item)
return itemlist