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

View File

@@ -9,8 +9,8 @@
"""
from specials import autoplay
from core import servertools, support, jsontools
##from specials import autoplay
from core import support #,servertools
from core.item import Item
from platformcode import config, logger
@@ -27,7 +27,7 @@ list_quality = ['default']
@support.menu
def mainlist(item):
film = [
('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']),
('Generi', ['', 'categorie', 'genres']),
@@ -40,18 +40,17 @@ def mainlist(item):
@support.scrape
def peliculas(item):
## import web_pdb; web_pdb.set_trace()
support.log('peliculas',item)
## support.dbg()
action="findvideos"
if item.args == "search":
patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">'
else:
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>[^"]+)"'\
'.+?[^>]+>[^>]+<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<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>'
'[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>.*?<p>(?P<plot>[^<]+)<'
patronNext = '<span>\d</span> <a href="([^"]+)">'
@@ -62,22 +61,24 @@ def peliculas(item):
@support.scrape
def categorie(item):
support.log('categorie',item)
## import web_pdb; web_pdb.set_trace()
if item.args != 'orderalf': action = "peliculas"
else: action = 'orderalf'
blacklist = 'altadefinizione01'
blacklist = ['Altadefinizione01']
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>'
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>'
elif item.args == 'orderalf':
patronBlock = r'<div class="movies-letter">(?P<block>.*)<div class="clearfix">'
patron = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
#support.regexDbg(item, patronBlock, headers)
return locals()
@support.scrape
@@ -108,7 +109,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
logger.error("%s Sono qua: %s" % (__channel__, line))
logger.error("search except %s: %s" % (__channel__, line))
return []
def newest(categoria):
@@ -130,4 +131,4 @@ def newest(categoria):
logger.error("{0}".format(line))
return []
return itemlist
return itemlist

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:
val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val
scraped[kk] = val
if scraped['title']:
title = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped['title'])
.replace('"', "'").replace('×', 'x').replace('',
@@ -213,7 +213,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
.replace('"', "'").replace('×', 'x').replace('', '-')).strip()
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 item.infoLabels["title"]:
@@ -247,7 +247,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
if scraped['type'] in variants:
action = name
if (scraped["title"] and scraped["title"] not in blacklist) or longtitle:
if (scraped["title"] not in blacklist) or longtitle:
it = Item(
channel=item.channel,
action=action,
@@ -354,9 +354,10 @@ def scrape(func):
checkHost(item, itemlist)
if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
or (item.contentType == "episode" and action != "play") \
or (item.contentType == "movie" and action != "play") :
## if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
## or (item.contentType == "episode" and action != "play") \
## or (item.contentType == "movie" and action != "play") :
if action != 'play':
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
# else: # Si perde item show :(
# for it in itemlist: