Fix episodi Toonitalia

This commit is contained in:
mac12m99
2021-07-21 18:34:35 +02:00
parent 03e609a2b7
commit a6c833b3ec
3 changed files with 17 additions and 19 deletions

View File

@@ -93,17 +93,15 @@ def peliculas(item):
@support.scrape
def episodios(item):
anime = True
def get_ep(item):
find = ''
data = support.match(item, headers=headers).data
match = support.match(data, patron=r'(?: /> |<p>)(?:(?P<season>\d+)&#215;)?(?P<episode>\d+)(?:\s+&#8211;\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
data = get_ep(item)
patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|'
# debug = True
patron = r'>\s*(?:(?P<season>\d+)(?:&#215;|x|×))?(?P<episode>\d+)(?:\s+&#8211;\s+)?[ ]+(?P<title2>[^<]+)[ ]+<a (?P<data>.*?)(?:<br|</p)'
# data = ''
# match = support.match(item, headers=headers, patron=r'(?: /> |<p>)(?:(?P<season>\d+)&#215;)?(?P<episode>\d+)(?:\s+&#8211;\s+)?(?P<title>[^<]+)<a (?P<data>.*?)(?:<br|</p)').matches
# if match:
# for m in match:
# data += '{}{:02d}|{}|{}|'.format(m[0]+'x' if m[0] else '', int(m[1]), clean_title(m[2]), m[3])
#
# patron = r'(?P<episode>[^|]+)\|(?P<title>[^|]+)\|(?P<data>[^|]+)\|'
return locals()

View File

@@ -552,13 +552,13 @@ def scrape(func):
if patronNext and inspect.stack()[1][3] not in ['newest'] and len(inspect.stack()) > 2 and inspect.stack()[2][3] not in ['get_channel_results']:
nextPage(itemlist, item, data, patronNext, function)
for it in itemlist:
if it.contentEpisodeNumber and it.contentSeason:
it.title = '[B]{:d}x{:02d} - {}[/B]'.format(it.contentSeason, it.contentEpisodeNumber, it.infoLabels['title'] if it.infoLabels['title'] else it.fulltitle)
if it.contentLanguage:
it.title += typo(it.contentLanguage, '_ [] color kod')
if it.quality:
it.title += typo(it.quality, '_ [] color kod')
# for it in itemlist:
# if it.contentEpisodeNumber and it.contentSeason:
# it.title = '[B]{:d}x{:02d} - {}[/B]'.format(it.contentSeason, it.contentEpisodeNumber, it.infoLabels['title'] if it.infoLabels['title'] else it.fulltitle)
# if it.contentLanguage:
# it.title += typo(it.contentLanguage, '_ [] color kod')
# if it.quality:
# it.title += typo(it.quality, '_ [] color kod')
# next page for pagination
if pagination and len(matches) > pag * pagination and not search:

View File

@@ -97,7 +97,7 @@ def process_request_proxy(url):
data = re.sub('\s(\w+)=(?!")([^<>\s]+)', r' \1="\2"', data)
data = re.sub('https://translate\.googleusercontent\.com/.*?u=(.*?)&amp;usg=[A-Za-z0-9_-]+', '\\1', data)
data = re.sub('https?://[a-zA-Z0-9-]+' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data)
data = re.sub('https?://[a-zA-Z0-9-]*' + domain.replace('.', '-') + '\.translate\.goog(/[a-zA-Z0-9#/-]+)', 'https://' + domain + '\\1', data)
data = re.sub('\s+<', '<', data)
data = data.replace('&amp;', '&').replace('https://translate.google.com/website?sl=' + SL + '&tl=' + TL + '&ajax=1&u=', '')