svariati fix ai canali
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
"altadefinizione01_link": "https://altadefinizione01.baby",
|
||||
"altadefinizioneclick": "https://altadefinizione.productions",
|
||||
"animeforce": "https://ww1.animeforce.org",
|
||||
"animeleggendari": "https://animepertutti.org",
|
||||
"animeleggendari": "https://animeora.com",
|
||||
"animesaturn": "https://www.animesaturn.com",
|
||||
"animestream": "https://www.animeworld.it",
|
||||
"animesubita": "http://www.animesubita.org",
|
||||
"animetubeita": "http://www.animetubeita.com",
|
||||
"animeunity": "https://www.animeunity.it",
|
||||
"animeworld": "https://www.animeworld.tv",
|
||||
"casacinema": "https://www.casacinema.pw",
|
||||
"casacinema": "https://www.casacinema.rest",
|
||||
"casacinemaInfo": "https://casacinema.life",
|
||||
"cb01anime": "https://www.cineblog01.red/",
|
||||
"cinemalibero": "https://cinemalibero.plus",
|
||||
|
||||
@@ -34,10 +34,11 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
support.log('peliculas',item)
|
||||
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+> (?P<duration>\d+)[^>]+>[^>]+> (?P<quality>[a-zA-Z]+) [^>]+>[^>]+> (?P<lang>[^>]+) [^>]+>'
|
||||
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+)[^>]+>[^>]+>)?\s*(?P<quality>[a-zA-Z]+) [^>]+>[^>]+> (?P<lang>[^>]+) [^>]+>'
|
||||
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
from core import support
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
|
||||
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = ['/category/film',
|
||||
@@ -90,7 +88,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('newest log: ', {0}.format(line))
|
||||
support.log("%s" % line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -98,6 +96,7 @@ def newest(categoria):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
if item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
elif item.contentType == 'tvshow':
|
||||
|
||||
@@ -87,7 +87,7 @@ def peliculas(item):
|
||||
|
||||
if len(item.args) > 1 and item.args[0] == 'last':
|
||||
patronBlock = r'<div id="%s"[^>]+>(?P<block>.*?)<div class="vistaDettagliata"' % item.args[1]
|
||||
patron = r'<li>\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)" class="thumb">[^>]+>[^>]+>[^>]+>\s*[EePp]+\s*(?P<episode>\d+)[^>]+>[^>]+>[^>]+>(?P<lang>[^<]*)<[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"'
|
||||
patron = r'<li>\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)" class="thumb">[^>]+>[^>]+>[^>]+>\s*[EePp]+\s*(?P<episode>\d+)[^>]+>\s<img src="(?P<thumb>[^"]+)"'
|
||||
else:
|
||||
patron = r'<div class="showStreaming"> <b>(?P<title>[^<]+)[^>]+>[^>]+>\s*<span>Lingua:\s*(?P<lang>[^>]+)?>[<>br\s]+a href="(?P<url>[^"]+)"[^>]+>.*?--image-url:url\(/*(?P<thumb>[^\)]+).*?Anno di inizio</b>:\s*(?P<year>[0-9]{4})'
|
||||
patronNext = '<li class="currentPage">[^>]+><li[^<]+<a href="([^"]+)">'
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
# Canale per HD4ME
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import httptools, support
|
||||
from core import support
|
||||
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
@@ -19,16 +17,18 @@ def mainlist(item):
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
if item.args == 'alternative':
|
||||
patron = r'<a title="(?P<title>[^\(]+)\(\s*(?P<year>\d+)\)\s\D+(?P<quality>\d+p) ... (?P<lang>[^ ]+).*?[^"]+"\s*href="(?P<url>[^"]+)'
|
||||
else:
|
||||
patron = r'<a href="(?P<url>[^"]+)" rel="[^"]+" title="(?P<title>[^\(]+)(?!\()\s*\((?P<year>\d+)\)\s\D+(?P<quality>\d+p) ... (?P<lang>[^ ]+).*?<img id="cov" src="(?P<thumb>[^"]+)"'
|
||||
patronNext = r'rel="next" href="([^"]+)"'
|
||||
patron = r'<a href="(?P<url>[^"]+)" rel="?[0-9]+"? title="(?P<title>[^\(]+)(?!\()\s*\((?P<year>\d+)\)\s\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?<img id="?cov"?.*?src="(?P<thumb>[^"]+)'
|
||||
patronNext = r'rel="?next"? href="([^"]+)"'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genre(item):
|
||||
action = 'peliculas'
|
||||
|
||||
@@ -89,7 +89,7 @@ def peliculas(item):
|
||||
else:
|
||||
patron = r'<div class="poster">\s?<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)" alt="[^"]+"><\/a>[^>]+>[^>]+>[^>]+> (?P<rating>[0-9.]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA|Sub-ita)\])?<[^>]+>[^>]+>[^>]+>(?P<year>[^<]+)(?:<.*?<div class="texto">(?P<plot>[^<]+))?'
|
||||
|
||||
patronNext = '<span class="current">[^<]+<[^>]+><a href="([^"]+)"'
|
||||
patronNext = '<span class="current">[^<]+<[^>]+><a href=[\'"]([^\'"]+)[\'"]'
|
||||
|
||||
#support.regexDbg(item, patron, headers)
|
||||
#debug = True
|
||||
|
||||
@@ -8,12 +8,9 @@ from core import support
|
||||
from core.support import config, log
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
|
||||
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ def peliculas(item):
|
||||
|
||||
elif item.contentType == 'tvshow':
|
||||
# SEZIONE Serie TV- Anime - Documentari
|
||||
pagination = 35
|
||||
# pagination = 35
|
||||
|
||||
if not item.args and 'anime' not in item.url:
|
||||
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+?href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[ ](?P<rating>\d+.\d+|\d+)<[^>]+>[^>]+><h2>(?P<title>[^"]+)</h2>[ ]?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
||||
@@ -85,7 +85,7 @@ def peliculas(item):
|
||||
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
||||
else:
|
||||
# SEZIONE FILM
|
||||
pagination = 25
|
||||
# pagination = 25
|
||||
|
||||
if item.args == 'lista':
|
||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.*?)(?P<year>\d{4})?<'
|
||||
|
||||
@@ -440,7 +440,7 @@ def scrape(func):
|
||||
log('PATRON= ', patron)
|
||||
if not data:
|
||||
page = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True)
|
||||
data = page.data.replace("'", '"')
|
||||
data = re.sub("='([^']+)'", '="\\1"', page.data)
|
||||
data = data.replace('\n', ' ')
|
||||
data = data.replace('\t', ' ')
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
@@ -532,7 +532,7 @@ def scrape(func):
|
||||
if config.get_setting('trakt_sync'):
|
||||
from core import trakt_tools
|
||||
trakt_tools.trakt_check(itemlist)
|
||||
log('scraping time: ' , time()-scrapingTime)
|
||||
log('scraping time: ', time()-scrapingTime)
|
||||
return itemlist
|
||||
|
||||
return wrapper
|
||||
@@ -927,6 +927,7 @@ def match(item_url_string, **args):
|
||||
data = data.replace('\n', ' ')
|
||||
data = data.replace('\t', ' ')
|
||||
data = re.sub(r'>\s+<', '><', data)
|
||||
data = re.sub(r'([a-zA-Z])"([a-zA-Z])', "\1'\2", data)
|
||||
|
||||
# collect blocks of a page
|
||||
if patronBlock:
|
||||
@@ -1122,6 +1123,7 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page=
|
||||
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
url=next_page,
|
||||
args=item.args,
|
||||
nextPage=True,
|
||||
thumbnail=thumb()))
|
||||
|
||||
return itemlist
|
||||
|
||||
2
tests.py
2
tests.py
@@ -155,7 +155,7 @@ class GenericChannelTest(unittest.TestCase):
|
||||
if self.ch in chNumRis: # so a priori quanti risultati dovrebbe dare
|
||||
for content in chNumRis[self.ch]:
|
||||
if content in it.title:
|
||||
risNum = len(itemlist) - 1 # - nextpage
|
||||
risNum = len([it for it in itemlist if not it.nextPage]) # not count nextpage
|
||||
self.assertEqual(chNumRis[self.ch][content], risNum,
|
||||
'channel ' + self.ch + ' -> ' + it.title + ' returned wrong number of results')
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user