Aggiornamento canale Altadefinizione01_link e modifiche a support

1. Versione definitiva di Altadefinzione01_link
2. modifiche lievi a support poichè nei titoli c'era " invece di '
3. aggiunta di lang a support
This commit is contained in:
greko
2019-05-26 16:15:27 +02:00
parent cd1640acda
commit 479d9042c8
3 changed files with 130 additions and 201 deletions
+16 -11
View File
@@ -95,7 +95,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
patronNext="", action="findvideos", addVideolibrary = True):
# patron: the patron to use for scraping page, all capturing group must match with listGroups
# listGroups: a list containing the scraping info obtained by your patron, in order
# accepted values are: url, title, thumb, quality, year, plot, duration, genre, rating
# accepted values are: url, title, thumb, quality, year, plot, duration, genre, rating, episode, lang
# header: values to pass to request header
# blacklist: titles that you want to exclude(service articles for example)
@@ -112,7 +112,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
# patron = 'blablabla'
# headers = [['Referer', host]]
# blacklist = 'Request a TV serie!'
# return support.scrape(item, itemlist, patron, ['thumb', 'quality', 'url', 'title', 'year', 'plot'],
# return support.scrape(item, itemlist, patron, ['thumb', 'quality', 'url', 'title', 'year', 'plot', 'episode', 'lang'],
# headers=headers, blacklist=blacklist)
itemlist = []
@@ -133,7 +133,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
blocks = scrapertoolsV2.find_multiple_matches(block, regex)
block = ""
for b in blocks:
block += "\n" + b
block += "\n" + str(b)
log('BLOCK ', n, '=', block)
else:
block = data
@@ -141,7 +141,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
matches = scrapertoolsV2.find_multiple_matches(block, patron)
log('MATCHES =', matches)
known_keys = ['url', 'title', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating'] #by greko aggiunto episode
known_keys = ['url', 'title', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'lang']
for match in matches:
if len(listGroups) > len(match): # to fix a bug
match = list(match)
@@ -154,15 +154,20 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val
scraped[kk] = val
title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).strip()
title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).replace('"', "'").strip()
plot = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["plot"]))
if scraped["quality"] and scraped["episode"]: # by greko aggiunto episode
longtitle = '[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B][COLOR blue][' + scraped["quality"] + '][/COLOR]' # by greko aggiunto episode
elif scraped["episode"]: # by greko aggiunto episode
longtitle = '[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B]' # by greko aggiunto episode
else:
longtitle = '[B]' + title + '[/B]'
longtitle = '[B]' + title + '[/B] '
if scraped["quality"]:
longtitle += '[COLOR blue][' + scraped["quality"] + '][/COLOR]'
if scraped["episode"]:
longtitle += '[B]' + scraped["episode"] + '[/B]'
if scraped["lang"]:
if 'sub' in scraped["lang"].lower():
lang = 'Sub-ITA'
else:
lang = 'ITA'
longtitle += '[COLOR blue][' + lang + '][/COLOR]'
if item.infoLabels["title"] or item.fulltitle: # if title is set, probably this is a list of episodes or video sources
infolabels = item.infoLabels