Pulizia import
This commit is contained in:
@@ -1,28 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per animeforce.org
|
||||
# Canale per AnimeForce
|
||||
# ------------------------------------------------------------
|
||||
import re
|
||||
import urllib
|
||||
import urlparse
|
||||
|
||||
from core import httptools, scrapertoolsV2, servertools, tmdb
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
from servers.decrypters import adfly
|
||||
from core.support import log
|
||||
from core import support
|
||||
|
||||
__channel__ = "animeforce"
|
||||
host = config.get_channel_url(__channel__)
|
||||
host = support.config.get_channel_url(__channel__)
|
||||
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_servers = ['directo', 'openload']
|
||||
list_quality = ['default']
|
||||
|
||||
checklinks = config.get_setting('checklinks', __channel__)
|
||||
checklinks_number = config.get_setting('checklinks_number', __channel__)
|
||||
checklinks = support.config.get_setting('checklinks', __channel__)
|
||||
checklinks_number = support.config.get_setting('checklinks_number', __channel__)
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -38,9 +31,9 @@ def mainlist(item):
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
item.url = host
|
||||
@@ -53,7 +46,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
support.logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -73,8 +66,8 @@ def peliculas(item):
|
||||
if item.args == 'update':
|
||||
patron = r'src="(?P<thumb>[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P<title>[^"]+").*?<h2><a href="(?P<url>[^"]+)"'
|
||||
def itemHook(item):
|
||||
delete = scrapertoolsV2.find_single_match(item.fulltitle, r'( Episodio.*)')
|
||||
number = scrapertoolsV2.find_single_match(item.title, r'Episodio (\d+)')
|
||||
delete = support.scrapertoolsV2.find_single_match(item.fulltitle, r'( Episodio.*)')
|
||||
number = support.scrapertoolsV2.find_single_match(item.title, r'Episodio (\d+)')
|
||||
item.title = support.typo(number + ' - ','bold') + item.title.replace(delete,'')
|
||||
item.fulltitle = item.show = item.fulltitle.replace(delete,'')
|
||||
item.url = item.url.replace('-episodio-'+ number,'')
|
||||
@@ -106,7 +99,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log(item)
|
||||
support.log(item)
|
||||
|
||||
itemlist = []
|
||||
|
||||
@@ -122,17 +115,17 @@ def findvideos(item):
|
||||
if 'adf.ly' in item.url:
|
||||
item.url = adfly.get_long_url(item.url)
|
||||
elif 'bit.ly' in item.url:
|
||||
item.url = httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
item.url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
|
||||
matches = support.match(item, r'button"><a href="([^"]+)"')[0]
|
||||
|
||||
for video in matches:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="play",
|
||||
title='diretto',
|
||||
url=video,
|
||||
server='directo'))
|
||||
support.Item(channel=item.channel,
|
||||
action="play",
|
||||
title='diretto',
|
||||
url=video,
|
||||
server='directo'))
|
||||
|
||||
support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
@@ -1,42 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per seriehd
|
||||
# Canale per SerieHD
|
||||
# ------------------------------------------------------------
|
||||
import urlparse
|
||||
import re
|
||||
|
||||
from channelselector import thumb
|
||||
from lib import cloudscraper
|
||||
from core import scrapertoolsV2, servertools, httptools, support
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from core.support import menu, log
|
||||
from platformcode import logger, config
|
||||
from specials import autoplay
|
||||
|
||||
|
||||
__channel__ = "seriehd"
|
||||
host = config.get_channel_url(__channel__)
|
||||
host = support.config.get_channel_url(__channel__)
|
||||
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_servers = ['verystream', 'openload', 'streamango', 'thevideome']
|
||||
list_quality = ['1080p', '720p', '480p', '360']
|
||||
|
||||
checklinks = config.get_setting('checklinks', 'seriehd')
|
||||
checklinks_number = config.get_setting('checklinks_number', 'seriehd')
|
||||
checklinks = support.config.get_setting('checklinks', __channel__)
|
||||
checklinks_number = support.config.get_setting('checklinks_number', __channel__)
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
tvshow = [('Genere', ['', 'genre', 'tv']),
|
||||
('Americane', ['/serie-tv-streaming/serie-tv-americane', 'peliculas', 'tv']),
|
||||
('Italiane', ['/serie-tv-streaming/serie-tv-italiane', 'peliculas', 'tv']),]
|
||||
tvshow = [('Genere', ['', 'genre']),
|
||||
('Americane', ['/serie-tv-streaming/serie-tv-americane', 'peliculas']),
|
||||
('Italiane', ['/serie-tv-streaming/serie-tv-italiane', 'peliculas']),]
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
log(texto)
|
||||
support.log(item)
|
||||
support.log(texto)
|
||||
# item.contentType = 'tvshow'
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -45,14 +41,14 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
support.logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
item.url = host
|
||||
@@ -65,7 +61,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
support.logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -87,26 +83,26 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
def episodios(item):
|
||||
log()
|
||||
support.log()
|
||||
itemlist = []
|
||||
url = support.match(item, patronBlock=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">')[1]
|
||||
seasons = support.match(item, r'<a href="([^"]+)">(\d+)<', r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers, url)[0]
|
||||
for season_url, season in seasons:
|
||||
season_url = urlparse.urljoin(url, season_url)
|
||||
season_url = support.urlparse.urljoin(url, season_url)
|
||||
episodes = support.match(item, r'<a href="([^"]+)">(\d+)<', '<h3>EPISODIO</h3><ul>(.*?)</ul>', headers, season_url)[0]
|
||||
for episode_url, episode in episodes:
|
||||
episode_url = urlparse.urljoin(url, episode_url)
|
||||
episode_url = support.urlparse.urljoin(url, episode_url)
|
||||
title = season + "x" + episode.zfill(2)
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType="episode",
|
||||
title=support.typo(title + ' - ' +item.show,'bold'),
|
||||
url=episode_url,
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
thumbnail=item.thumbnail))
|
||||
support.Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType="episode",
|
||||
title=support.typo(title + ' - ' +item.show,'bold'),
|
||||
url=episode_url,
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
thumbnail=item.thumbnail))
|
||||
|
||||
support.videolibrary(itemlist, item, 'color kod bold')
|
||||
|
||||
@@ -114,7 +110,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
support.log()
|
||||
itemlist = []
|
||||
itemlist = support.hdpass_get_servers(item)
|
||||
return support.controls(itemlist, item)
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
# Canale per ToonItalia
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import re
|
||||
|
||||
from core import httptools, support
|
||||
from platformcode import config, logger
|
||||
from core import support
|
||||
|
||||
__channel__ = "toonitalia"
|
||||
host = config.get_channel_url(__channel__)
|
||||
host = support.config.get_channel_url(__channel__)
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -26,7 +23,7 @@ def mainlist(item):
|
||||
tvshow = '/lista-serie-tv/'
|
||||
anime =['/lista-anime-2/',
|
||||
('Sub-Ita',['/lista-anime-sub-ita/']),
|
||||
('Film Animati',['/lista-film-animazione/','peliculas', 'movie'])]
|
||||
('Film Animati',['/lista-film-animazione/','peliculas', '', 'movie'])]
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
@@ -36,8 +33,8 @@ def mainlist(item):
|
||||
def peliculas(item):
|
||||
pagination = ''
|
||||
anime = True
|
||||
blacklist = '-Film Animazione disponibili in attesa di recensione (Link Wstream)-">-Film Animazione disponibili in attesa di recensione (Link Wstream)-'
|
||||
if item.args == 'movie': contentType = 'movie'
|
||||
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
||||
|
||||
if item.args == 'search':
|
||||
patron = r'<h2 class="entry-title"><a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>'
|
||||
elif item.args == 'last':
|
||||
@@ -59,7 +56,7 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
def check(item):
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
data = support.httptools.downloadpage(item.url, headers=headers).data
|
||||
item.action = 'episodios'
|
||||
if 'https://vcrypt.net' in data: item.patron = '(?:<br /> |<p>)(?P<title>[^<]+)<a href="(?P<url>[^"]+)"'
|
||||
else: item.patron = '<br /> <a href="(?P<url>[^"]+)" target="_blank" rel="noopener[^>]+>(?P<title>[^<]+)</a>'
|
||||
@@ -68,17 +65,17 @@ def check(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodios(item):
|
||||
anime = True
|
||||
patron = item.patron
|
||||
|
||||
def itemHook(item):
|
||||
support.log(patron)
|
||||
item.title = item.fulltitle.replace('_',' ').replace('–','-')
|
||||
item.title = support.typo(re.sub(item.show + ' - ','',item.title, flags=re.I).strip(' - '), 'bold')
|
||||
item.title = item.title.replace('_',' ').replace('–','-')
|
||||
item.title = support.re.sub(item.fulltitle + ' - ','',item.title)
|
||||
return item
|
||||
|
||||
return locals()
|
||||
|
||||
def findvideos(item):
|
||||
return support.server(item, item.url if item.contentType != 'movie' else httptools.downloadpage(item.url, headers=headers).data )
|
||||
return support.server(item, item.url if item.contentType != 'movie' else support.httptools.downloadpage(item.url, headers=headers).data )
|
||||
|
||||
Reference in New Issue
Block a user