pulizia
This commit is contained in:
+14
-14
@@ -7,7 +7,7 @@ import re
|
||||
|
||||
import urlparse
|
||||
|
||||
from core import scrapertoolsV2, httptools, tmdb, support,servertools
|
||||
from core import scrapertools, httptools, tmdb, support,servertools
|
||||
from core.item import Item
|
||||
from core.support import menu, log
|
||||
from platformcode import logger
|
||||
@@ -22,7 +22,7 @@ def findhost():
|
||||
pass
|
||||
# global host, headers
|
||||
# permUrl = httptools.downloadpage('https://www.tantifilm.info/', follow_redirects=False).data
|
||||
# host = scrapertoolsV2.find_single_match(permUrl, r'<h2 style="text-align: center;"><a href="([^"]+)">Il nuovo indirizzo di Tantifilm è:</a></h2>')
|
||||
# host = scrapertools.find_single_match(permUrl, r'<h2 style="text-align: center;"><a href="([^"]+)">Il nuovo indirizzo di Tantifilm è:</a></h2>')
|
||||
# if host.endswith('/'):
|
||||
# host = host[:-1]
|
||||
# headers = [['Referer', host]]
|
||||
@@ -90,7 +90,7 @@ def episodios(item):
|
||||
else:
|
||||
data_check = item.data
|
||||
patron_check = r'<iframe src="([^"]+)" scrolling="no" frameborder="0" width="626" height="550" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">'
|
||||
item.url = scrapertoolsV2.find_single_match(data_check, patron_check)
|
||||
item.url = scrapertools.find_single_match(data_check, patron_check)
|
||||
|
||||
patronBlock = r'Stagioni<\/a>.*?<ul class="nav navbar-nav">(?P<block>.*?)<\/ul>'
|
||||
patron = r'<a href="(?P<url>[^"]+)"\s*>\s*<i[^>]+><\/i>\s*(?P<episode>\d+)<\/a>'
|
||||
@@ -105,8 +105,8 @@ def episodios(item):
|
||||
season_data = httptools.downloadpage(item.url).data
|
||||
season_data = re.sub('\n|\t', ' ', season_data)
|
||||
season_data = re.sub(r'>\s+<', '> <', season_data)
|
||||
block = scrapertoolsV2.find_single_match(season_data, 'Episodi.*?<ul class="nav navbar-nav">(.*?)</ul>')
|
||||
episodes = scrapertoolsV2.find_multiple_matches(block, '<a href="([^"]+)"\s*>\s*<i[^>]+><\/i>\s*(\d+)<\/a>')
|
||||
block = scrapertools.find_single_match(season_data, 'Episodi.*?<ul class="nav navbar-nav">(.*?)</ul>')
|
||||
episodes = scrapertools.find_multiple_matches(block, '<a href="([^"]+)"\s*>\s*<i[^>]+><\/i>\s*(\d+)<\/a>')
|
||||
for url, episode in episodes:
|
||||
i = item.clone()
|
||||
i.action = 'findvideos'
|
||||
@@ -136,9 +136,9 @@ def anime(item):
|
||||
|
||||
seasons = support.match(item, r'<div class="sp-body[^"]+">(.*?)<\/div>')[0]
|
||||
for season in seasons:
|
||||
episodes = scrapertoolsV2.find_multiple_matches(season, r'<a.*?href="([^"]+)"[^>]+>([^<]+)<\/a>(.*?)<(:?br|\/p)')
|
||||
episodes = scrapertools.find_multiple_matches(season, r'<a.*?href="([^"]+)"[^>]+>([^<]+)<\/a>(.*?)<(:?br|\/p)')
|
||||
for url, title, urls, none in episodes:
|
||||
urls = scrapertoolsV2.find_multiple_matches(urls, '<a.*?href="([^"]+)"[^>]+>')
|
||||
urls = scrapertools.find_multiple_matches(urls, '<a.*?href="([^"]+)"[^>]+>')
|
||||
|
||||
for url2 in urls:
|
||||
url += url2 + '\n'
|
||||
@@ -192,8 +192,8 @@ def search(item, texto):
|
||||
## for url, title, year, thumb, quality in matches:
|
||||
## infoLabels = {}
|
||||
## infoLabels['year'] = year
|
||||
## title = scrapertoolsV2.decodeHtmlentities(title)
|
||||
## quality = scrapertoolsV2.decodeHtmlentities(quality)
|
||||
## title = scrapertools.decodeHtmlentities(title)
|
||||
## quality = scrapertools.decodeHtmlentities(quality)
|
||||
## longtitle = title + support.typo(quality,'_ [] color kod')
|
||||
## itemlist.append(
|
||||
## Item(channel=item.channel,
|
||||
@@ -221,7 +221,7 @@ def newest(categoria):
|
||||
matches = support.match(item, r'mediaWrapAlt recomended_videos"[^>]+>\s*<a href="([^"]+)" title="([^"]+)" rel="bookmark">\s*<img[^s]+src="([^"]+)"[^>]+>')[0]
|
||||
|
||||
for url, title, thumb in matches:
|
||||
title = scrapertoolsV2.decodeHtmlentities(title).replace("Permalink to ", "").replace("streaming", "")
|
||||
title = scrapertools.decodeHtmlentities(title).replace("Permalink to ", "").replace("streaming", "")
|
||||
title = re.sub(r'\s\(\d+\)','',title)
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
@@ -250,7 +250,7 @@ def findvideos(item):
|
||||
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
check = scrapertoolsV2.find_single_match(data, r'<div class="category-film">\s+<h3>\s+(.*?)\s+</h3>\s+</div>')
|
||||
check = scrapertools.find_single_match(data, r'<div class="category-film">\s+<h3>\s+(.*?)\s+</h3>\s+</div>')
|
||||
if 'sub' in check.lower():
|
||||
item.contentLanguage = 'Sub-ITA'
|
||||
support.log("CHECK : ", check)
|
||||
@@ -265,7 +265,7 @@ def findvideos(item):
|
||||
return episodios(item)
|
||||
|
||||
if 'protectlink' in data:
|
||||
urls = scrapertoolsV2.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||
urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||
support.log("SONO QUI: ", urls)
|
||||
for url in urls:
|
||||
url = url.decode('base64')
|
||||
@@ -273,7 +273,7 @@ def findvideos(item):
|
||||
url, c = unshorten_only(url)
|
||||
if 'nodmca' in url:
|
||||
page = httptools.downloadpage(url, headers=headers).data
|
||||
url = '\t' + scrapertoolsV2.find_single_match(page,'<meta name="og:url" content="([^=]+)">')
|
||||
url = '\t' + scrapertools.find_single_match(page, '<meta name="og:url" content="([^=]+)">')
|
||||
if url:
|
||||
listurl.add(url)
|
||||
return support.server(item, data=listurl if listurl else data)#, headers=headers)
|
||||
@@ -286,7 +286,7 @@ def findvideos(item):
|
||||
## data = item.url if item.contentType == "episode" else httptools.downloadpage(item.url, headers=headers).data
|
||||
##
|
||||
## if 'protectlink' in data:
|
||||
## urls = scrapertoolsV2.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||
## urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||
## for url in urls:
|
||||
## url = url.decode('base64')
|
||||
## data += '\t' + url
|
||||
|
||||
Reference in New Issue
Block a user