Fix Ricerca Toonitalia
This commit is contained in:
+13
-14
@@ -30,7 +30,7 @@ def search(item, texto):
|
|||||||
support.info(texto)
|
support.info(texto)
|
||||||
item.args='search'
|
item.args='search'
|
||||||
item.contentType='tvshow'
|
item.contentType='tvshow'
|
||||||
item.url = host + '/?s=' + texto
|
item.url = host + '/wp-json/wp/v2/search?search=' + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
@@ -45,7 +45,7 @@ def newest(categoria):
|
|||||||
support.info(categoria)
|
support.info(categoria)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'undefined'
|
||||||
item.url= host
|
item.url= host
|
||||||
item.args= 'new'
|
item.args= 'new'
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
@@ -61,20 +61,16 @@ def newest(categoria):
|
|||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
pagination = ''
|
pagination = ''
|
||||||
anime = True
|
anime = True
|
||||||
# debug = True
|
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
|
||||||
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
||||||
|
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
patron = r'<h2 class="entry-title"><a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>.*?<p>(?P<plot>[^<]+)</p>.*?<span class="cat-links">Pubblicato in.*?.*?(?P<type>(?:[Ff]ilm|</artic))[^>]+>'
|
action = 'check'
|
||||||
typeContentDict={'movie':['film']}
|
data = support.match(item).data.replace('\\','')
|
||||||
typeActionDict={'findvideos':['film']}
|
patron = r'"title":"(?P<title>[^"]+)","url":"(?P<url>[^"]+)'
|
||||||
patronNext = r'<a href="([^"]+)"\s*>Articoli meno recenti'
|
|
||||||
elif item.args == 'last':
|
elif item.args == 'last':
|
||||||
patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>'
|
patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src(?:set)?="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)'
|
patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src(?:set)?="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)'
|
||||||
# elif item.args == 'most_view':
|
|
||||||
# patronBlock = 'I piu visti</h2>(?P<block>.*)</ul>'
|
|
||||||
# patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
|
||||||
elif item.args == 'new':
|
elif item.args == 'new':
|
||||||
patronBlock = '<main[^>]+>(?P<block>.*)</main>'
|
patronBlock = '<main[^>]+>(?P<block>.*)</main>'
|
||||||
patron = r'<a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)".*?<p>(?P<plot>[^<]+)</p>.*?<span class="cat-links">Pubblicato in.*?.*?(?P<type>(?:[Ff]ilm|</artic))[^>]+>'
|
patron = r'<a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)".*?<p>(?P<plot>[^<]+)</p>.*?<span class="cat-links">Pubblicato in.*?.*?(?P<type>(?:[Ff]ilm|</artic))[^>]+>'
|
||||||
@@ -94,16 +90,19 @@ def peliculas(item):
|
|||||||
item.title = item.title.replace('[ITA]','[Sub-ITA]')
|
item.title = item.title.replace('[ITA]','[Sub-ITA]')
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
return item
|
return item
|
||||||
|
|
||||||
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
|
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
def check(item):
|
||||||
|
if support.match(item, headers=headers, patron=r'(category tag">Film)').match:
|
||||||
|
item.contentType = 'movie'
|
||||||
|
return findvideos(item)
|
||||||
|
else:
|
||||||
|
item.contentType = 'tvshow'
|
||||||
|
return episodios(item)
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime = True
|
anime = True
|
||||||
# debug=True
|
|
||||||
data = support.match(item, headers=headers).data
|
data = support.match(item, headers=headers).data
|
||||||
if 'https://vcrypt.net' in data:
|
if 'https://vcrypt.net' in data:
|
||||||
patron = r'(?: /> |<p>)(?P<episode>\d+.\d+)?(?: – )?(?P<title>[^<]+)<a (?P<url>.*?)(?:<br|</p)'
|
patron = r'(?: /> |<p>)(?P<episode>\d+.\d+)?(?: – )?(?P<title>[^<]+)<a (?P<url>.*?)(?:<br|</p)'
|
||||||
|
|||||||
Reference in New Issue
Block a user