fix: support - sistemato altadefinizione01 per uso completo dei decoratori

This commit is contained in:
greko17
2019-08-07 23:01:39 +02:00
parent 135c0139fa
commit c8ea6adc94
2 changed files with 22 additions and 20 deletions
+15 -14
View File
@@ -9,8 +9,8 @@
""" """
from specials import autoplay ##from specials import autoplay
from core import servertools, support, jsontools from core import support #,servertools
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
@@ -27,7 +27,7 @@ list_quality = ['default']
@support.menu @support.menu
def mainlist(item): def mainlist(item):
film = [ film = [
('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']), ('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']),
('Generi', ['', 'categorie', 'genres']), ('Generi', ['', 'categorie', 'genres']),
@@ -40,18 +40,17 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
## import web_pdb; web_pdb.set_trace()
support.log('peliculas',item) support.log('peliculas',item)
## support.dbg()
action="findvideos" action="findvideos"
if item.args == "search": if item.args == "search":
patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">' patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">'
else: else:
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">' patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
patron = r'<div class="cover boxcaption"> <h2>.<a href="(?P<url>[^"]+)">.*?<.*?src="(?P<thumb>[^"]+)"'\ patron = r'<div class="cover boxcaption"> <h2>.<a href="(?P<url>[^"]+)">.*?<.*?src="(?P<thumb>[^"]+)"'\
'.+?[^>]+>[^>]+<div class="trdublaj"> (?P<quality>[A-Z]+)<[^>]+>(?:.[^>]+>(?P<lang>.*?)<[^>]+>).*?'\ '.+?[^>]+>[^>]+<div class="trdublaj"> (?P<quality>[A-Z/]+)<[^>]+>(?:.[^>]+>(?P<lang>.*?)<[^>]+>).*?'\
'<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> '\ '<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> '\
'[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>' '[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>.*?<p>(?P<plot>[^<]+)<'
patronNext = '<span>\d</span> <a href="([^"]+)">' patronNext = '<span>\d</span> <a href="([^"]+)">'
@@ -62,22 +61,24 @@ def peliculas(item):
@support.scrape @support.scrape
def categorie(item): def categorie(item):
support.log('categorie',item) support.log('categorie',item)
## import web_pdb; web_pdb.set_trace()
if item.args != 'orderalf': action = "peliculas" if item.args != 'orderalf': action = "peliculas"
else: action = 'orderalf' else: action = 'orderalf'
blacklist = 'altadefinizione01'
blacklist = ['Altadefinizione01']
if item.args == 'genres': if item.args == 'genres':
patronBlock = r'<ul class="kategori_list">(?P<block>.*)</ul>' patronBlock = r'<ul class="kategori_list">(?P<block>.*)<div class="tab-pane fade" id="wtab2">'
patron = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>' patron = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
elif item.args == 'years': elif item.args == 'years':
patronBlock = r'<ul class="anno_list">(?P<block>.*)</ul>' patronBlock = r'<ul class="anno_list">(?P<block>.*)</a></li> </ul> </div>'
patron = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>' patron = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
elif item.args == 'orderalf': elif item.args == 'orderalf':
patronBlock = r'<div class="movies-letter">(?P<block>.*)<div class="clearfix">' patronBlock = r'<div class="movies-letter">(?P<block>.*)<div class="clearfix">'
patron = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>' patron = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
#support.regexDbg(item, patronBlock, headers)
return locals() return locals()
@support.scrape @support.scrape
@@ -108,7 +109,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
logger.error("%s Sono qua: %s" % (__channel__, line)) logger.error("search except %s: %s" % (__channel__, line))
return [] return []
def newest(categoria): def newest(categoria):
@@ -130,4 +131,4 @@ def newest(categoria):
logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
+7 -6
View File
@@ -193,7 +193,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
if val and (kk == "url" or kk == 'thumb') and 'http' not in val: if val and (kk == "url" or kk == 'thumb') and 'http' not in val:
val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val
scraped[kk] = val scraped[kk] = val
if scraped['title']: if scraped['title']:
title = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped['title']) title = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped['title'])
.replace('"', "'").replace('×', 'x').replace('', .replace('"', "'").replace('×', 'x').replace('',
@@ -213,7 +213,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
.replace('"', "'").replace('×', 'x').replace('', '-')).strip() .replace('"', "'").replace('×', 'x').replace('', '-')).strip()
longtitle = longtitle + typo(title2, 'bold _ -- _') longtitle = longtitle + typo(title2, 'bold _ -- _')
lang, longitle = scrapeLang(scraped, lang, longtitle) lang, longtitle = scrapeLang(scraped, lang, longtitle)
# if title is set, probably this is a list of episodes or video sources # if title is set, probably this is a list of episodes or video sources
if item.infoLabels["title"]: if item.infoLabels["title"]:
@@ -247,7 +247,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
if scraped['type'] in variants: if scraped['type'] in variants:
action = name action = name
if (scraped["title"] and scraped["title"] not in blacklist) or longtitle: if (scraped["title"] not in blacklist) or longtitle:
it = Item( it = Item(
channel=item.channel, channel=item.channel,
action=action, action=action,
@@ -354,9 +354,10 @@ def scrape(func):
checkHost(item, itemlist) checkHost(item, itemlist)
if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \ ## if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
or (item.contentType == "episode" and action != "play") \ ## or (item.contentType == "episode" and action != "play") \
or (item.contentType == "movie" and action != "play") : ## or (item.contentType == "movie" and action != "play") :
if action != 'play':
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
# else: # Si perde item show :( # else: # Si perde item show :(
# for it in itemlist: # for it in itemlist: