Fix AnimeUnity, HD4ME, ToonItalia
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
"streamtime": "https://t.me/s/StreamTime",
|
||||
"tantifilm": "https://www.tantifilm.vision",
|
||||
"tapmovie": "https://it.tapmovie.net",
|
||||
"toonitalia": "https://toonitalia.pro",
|
||||
"toonitalia": "https://toonitalia.co",
|
||||
"vvvvid": "https://www.vvvvid.it"
|
||||
},
|
||||
"findhost": {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Canale per AnimeUnity
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from lib.requests.sessions import session
|
||||
import requests, json, copy, inspect
|
||||
from core import support
|
||||
from platformcode import autorenumber
|
||||
@@ -115,8 +116,10 @@ def news(item):
|
||||
support.info()
|
||||
item.contentType = 'episode'
|
||||
itemlist = []
|
||||
import cloudscraper
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
fullJs = json.loads(support.match(item, headers=headers, patron=r'items-json="([^"]+)"').match.replace('"','"'))
|
||||
fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"', debug=True).match.replace('"','"'))
|
||||
js = fullJs['data']
|
||||
|
||||
for it in js:
|
||||
|
||||
@@ -26,7 +26,7 @@ def peliculas(item):
|
||||
patron = r'<a title="(?P<title>[^\(]+)\(\s*(?P<year>\d+)\)\s\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?[^"]+"\s*href="(?P<url>[^"]+)'
|
||||
else:
|
||||
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="([^"]+)"'
|
||||
patronNext = r'current(?:[^>]*>){2}\s*<a class="[^"]+"\s* href="([^"]+)'
|
||||
return locals()
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"id": "toonitalia",
|
||||
"name": "ToonItalia",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"active": true,
|
||||
"thumbnail": "toonitalia.png",
|
||||
"banner": "toonitalia.png",
|
||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Canale per ToonItalia
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core import scrapertools, support
|
||||
import sys
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
@@ -76,7 +76,7 @@ def peliculas(item):
|
||||
else:
|
||||
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>[^"]+)"[^>]+>(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)".*?<p>(?P<plot>[^<]+)</p>.*?tag">.*?(?P<type>(?:[Ff]ilm|</art|Serie Tv))'
|
||||
patron = r'<a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>(:?[^>]+>){3}(?:<img.*?src="(?P<thumb>[^"]+)")?.*?<p>(?P<plot>[^<]+)</p>.*?tag">.*?(?P<type>(?:[Ff]ilm|</art|Serie Tv))'
|
||||
typeContentDict={'movie':['film']}
|
||||
typeActionDict={'findvideos':['film']}
|
||||
patronNext = '<a class="next page-numbers" href="([^"]+)">'
|
||||
@@ -93,21 +93,27 @@ def peliculas(item):
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
anime = True
|
||||
data = support.match(item, headers=headers).data
|
||||
if 'https://vcrypt.net' in data:
|
||||
patron = r'(?: /> |<p>)(?P<episode>\d+.\d+)?(?: – )?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)'
|
||||
else:
|
||||
patron = r'<br />\s*<a href="(?P<url>[^"]+)" target="_blank" rel="noopener[^>]+>(?P<episode>\d+.\d+)?(?: – )?(?P<title>[^<]+)</a>'
|
||||
def get_ep(item):
|
||||
find = ''
|
||||
data = support.match(item, headers=headers).data
|
||||
match = support.match(data, patron=r'(?: /> |<p>)(?:(?P<season>\d+)×)?(?P<episode>\d+)(?:\s+–\s+)?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)').matches
|
||||
if match:
|
||||
for m in match:
|
||||
find += '{}{:02d}|{}|{}|'.format(m[0]+'x' if m[0] else '', int(m[1]), clean_title(m[2]), m[3])
|
||||
return find
|
||||
|
||||
def itemHook(item):
|
||||
item.title = support.re.sub(r'\[B\]|\[/B\]', '', item.title)
|
||||
item.title = item.title.replace('_',' ').replace('–','-').replace('×','x').replace('-','-').replace(' ',' ')
|
||||
item.title = support.re.sub(item.fulltitle + ' - ','',item.title)
|
||||
item.title = support.typo(item.title.strip(' -'),'bold')
|
||||
return item
|
||||
data = get_ep(item)
|
||||
patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
return support.server(item, item.data if item.contentType != 'movie' else support.match(item.url, headers=headers).data )
|
||||
|
||||
|
||||
def clean_title(title):
|
||||
title = scrapertools.unescape(title)
|
||||
title = title.replace('_',' ').replace('–','-').replace(' ',' ')
|
||||
title = title.strip(' - ')
|
||||
return title
|
||||
Reference in New Issue
Block a user