CB01 Fix with Auto Thumb
This commit is contained in:
@@ -11,6 +11,7 @@ from core import scrapertoolsV2, httptools, servertools, tmdb
|
|||||||
from core.item import Item
|
from core.item import Item
|
||||||
from lib import unshortenit
|
from lib import unshortenit
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
|
from channelselector import thumb
|
||||||
|
|
||||||
#impostati dinamicamente da getUrl()
|
#impostati dinamicamente da getUrl()
|
||||||
host = ""
|
host = ""
|
||||||
@@ -42,74 +43,66 @@ def mainlist(item):
|
|||||||
action="video",
|
action="video",
|
||||||
title="[B]Film[/B]",
|
title="[B]Film[/B]",
|
||||||
url=host,
|
url=host,
|
||||||
contentType="movie",
|
contentType="movie"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Menù HD[/B]",
|
title="[B] > Film HD[/B]",
|
||||||
extra='Film HD Streaming',
|
extra='Film HD Streaming',
|
||||||
url=host,
|
url=host,
|
||||||
contentType="movie",
|
contentType="movie"),
|
||||||
thumbnail="http://jcrent.com/apple%20tv%20final/HD.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Film per Genere[/B]",
|
title="[B] > Film per Genere[/B]",
|
||||||
extra='Film per Genere',
|
extra='Film per Genere',
|
||||||
url=host,
|
url=host,
|
||||||
contentType="movie",
|
contentType="movie"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Film per Anno[/B]",
|
title="[B] > Film per Anno[/B]",
|
||||||
extra='Film per Anno',
|
extra='Film per Anno',
|
||||||
url=host,
|
url=host,
|
||||||
contentType="movie",
|
contentType="movie"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="search",
|
action="search",
|
||||||
title="[COLOR blue] > Cerca Film[/COLOR]",
|
title="[COLOR blue] > Cerca Film[/COLOR]",
|
||||||
contentType="movie",
|
contentType="movie",
|
||||||
url=host,
|
url=host,),
|
||||||
thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search"),
|
|
||||||
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="video",
|
action="video",
|
||||||
title="[B]Serie TV[/B]",
|
title="[B]Serie TV[/B]",
|
||||||
url=host + '/serietv/',
|
url=host + '/serietv/',
|
||||||
contentType="episode",
|
contentType="episode"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Serie-Tv per Lettera[/B]",
|
title="[B] > Serie-Tv per Lettera[/B]",
|
||||||
extra='Serie-Tv per Lettera',
|
extra='Serie-Tv per Lettera',
|
||||||
url=host + '/serietv/',
|
url=host + '/serietv/',
|
||||||
contentType="episode",
|
contentType="episode"),
|
||||||
thumbnail="http://jcrent.com/apple%20tv%20final/HD.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Serie-Tv per Genere[/B]",
|
title="[B] > Serie-Tv per Genere[/B]",
|
||||||
extra='Serie-Tv per Genere',
|
extra='Serie-Tv per Genere',
|
||||||
url=host + '/serietv/',
|
url=host + '/serietv/',
|
||||||
contentType="episode",
|
contentType="episode"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="menu",
|
action="menu",
|
||||||
title="[B] > Serie-Tv per Anno[/B]",
|
title="[B] > Serie-Tv per Anno[/B]",
|
||||||
extra='Serie-Tv per Anno',
|
extra='Serie-Tv per Anno',
|
||||||
url=host + '/serietv/',
|
url=host + '/serietv/',
|
||||||
contentType="episode",
|
contentType="episode"),
|
||||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
action="search",
|
action="search",
|
||||||
title="[COLOR blue] > Cerca Serie TV[/COLOR]",
|
title="[COLOR blue] > Cerca Serie TV[/COLOR]",
|
||||||
contentType="episode",
|
contentType="episode",
|
||||||
url=host + '/serietv/',
|
url=host + '/serietv/'),
|
||||||
thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search"),
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
autoplay.show_option(item.channel, itemlist)
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
|
||||||
|
# auto thumb
|
||||||
|
itemlist=thumb(itemlist)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def menu(item):
|
def menu(item):
|
||||||
@@ -117,7 +110,8 @@ def menu(item):
|
|||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
data = re.sub('\n|\t','',data)
|
data = re.sub('\n|\t','',data)
|
||||||
block = scrapertoolsV2.get_match(data, item.extra + r'<span.*?><\/span>.*?<ul.*?>(.*?)<\/ul>')
|
block = scrapertoolsV2.get_match(data, item.extra + r'<span.*?><\/span>.*?<ul.*?>(.*?)<\/ul>')
|
||||||
patron = r'href="([^"]+)">(.*?)<\/a>'
|
logger.info('MENU BLOCK= '+block)
|
||||||
|
patron = r'href=([^>]+)>(.*?)<\/a>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(block)
|
matches = re.compile(patron, re.DOTALL).findall(block)
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -186,12 +180,14 @@ def video(item):
|
|||||||
|
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
data = re.sub('\n|\t','',data)
|
data = re.sub('\n|\t','',data)
|
||||||
block = scrapertoolsV2.get_match(data, r'<div class="sequex-page-left">(.*?)<aside class="sequex-page-right">')
|
# block = scrapertoolsV2.get_match(data, r'<div class="sequex-page-left">(.*?)<aside class="sequex-page-right">')
|
||||||
|
block = scrapertoolsV2.get_match(data, r'<div class=sequex-page-left>(.*?)<aside class=sequex-page-right>')
|
||||||
|
# logger.info('BLOCK= '+block)
|
||||||
if item.contentType == 'movie' or '/serietv/' not in item.url:
|
if item.contentType == 'movie' or '/serietv/' not in item.url:
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
logger.info("### FILM ###")
|
logger.info("### FILM ###")
|
||||||
patron = r'type-post.*?>.*?<img src="([^"]+)".*?<h3.*?<a href="([^"]+)">([^<]+)<\/a>.*?<strong>([^<]+)<.*?br \/>\s+(.*?) '
|
# patron = r'type-post.*?>.*?<img src="([^"]+)".*?<h3.*?<a href="([^"]+)">([^<]+)<\/a>.*?<strong>([^<]+)<.*?br \/>\s+(.*?) '
|
||||||
|
patron = r'<div class=card-image>.*?<img src=(.*?)alt.*?<h3.*?<a href=(.*?)\/>([^<]+)<\/a><\/h3>(.*?)<br \/>(.*?)<\/a>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(block)
|
matches = re.compile(patron, re.DOTALL).findall(block)
|
||||||
|
|
||||||
logger.info("### MATCHES ###" + str(matches))
|
logger.info("### MATCHES ###" + str(matches))
|
||||||
@@ -232,11 +228,12 @@ def video(item):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
action = 'episodios'
|
action = 'episodios'
|
||||||
patron = 'type-post.*?>(.*?)<div class="card-action">'
|
patron = 'type-post.*?>(.*?)<div class=card-action>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(block)
|
matches = re.compile(patron, re.DOTALL).findall(block)
|
||||||
|
|
||||||
for match in matches:
|
for match in matches:
|
||||||
patron = r'<img src="([^"]+)".*?<h3.*?<a href="([^"]+)">([^<]+)<\/a>.*?<p>(.*?)\(([0-9]+).*?\).*?<\/p>([^<>]*)(?:<\/p>)?'
|
# patron = r'<img src="([^"]+)".*?<h3.*?<a href="([^"]+)">([^<]+)<\/a>.*?<p>(.*?)\(([0-9]+).*?\).*?<\/p>([^<>]*)(?:<\/p>)?'
|
||||||
|
patron = r'<img src=(.*?)alt.*?.*?<h3.*?<a href=(.*?)\/>([^<]+)<\/a>.*?<span.*?>(.*?)\(([0-9]+).*?\).*?<\/p>([^<>]*)(?:<\/p>)?'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(match)
|
matches = re.compile(patron, re.DOTALL).findall(match)
|
||||||
for scrapedthumb, scrapedurl, scrapedtitle, scrapedgenre, scrapedyear, scrapedplot in matches:
|
for scrapedthumb, scrapedurl, scrapedtitle, scrapedgenre, scrapedyear, scrapedplot in matches:
|
||||||
longtitle = '[B]' + scrapedtitle + '[/B]'
|
longtitle = '[B]' + scrapedtitle + '[/B]'
|
||||||
@@ -283,7 +280,7 @@ def episodios(item):
|
|||||||
data = re.sub('\n|\t','',data)
|
data = re.sub('\n|\t','',data)
|
||||||
block = scrapertoolsV2.get_match(data, r'<article class="sequex-post-content">(.*?)<\/article>').replace('×','x').replace(' – ','')
|
block = scrapertoolsV2.get_match(data, r'<article class="sequex-post-content">(.*?)<\/article>').replace('×','x').replace(' – ','')
|
||||||
logger.info(block)
|
logger.info(block)
|
||||||
blockSeason = scrapertoolsV2.find_multiple_matches(block, '<div class="sp-head[a-z ]*?" title="Espandi">([^<>]*?)</div>(.*?)<div class="spdiv">\[riduci\]</div>')
|
blockSeason = scrapertoolsV2.find_multiple_matches(block, r'<div class="sp-head[a-z ]*?" title="Espandi">([^<>]*?)</div>(.*?)<div class="spdiv">\[riduci\]</div>')
|
||||||
for season, block in blockSeason:
|
for season, block in blockSeason:
|
||||||
patron = r'(?:<p>)?([0-9]+x[0-9]+)(.*?)(?:</p>|<br)'
|
patron = r'(?:<p>)?([0-9]+x[0-9]+)(.*?)(?:</p>|<br)'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(block)
|
matches = re.compile(patron, re.DOTALL).findall(block)
|
||||||
@@ -313,8 +310,9 @@ def findvideos(item):
|
|||||||
if item.contentType == "episode":
|
if item.contentType == "episode":
|
||||||
return findvid_serie(item)
|
return findvid_serie(item)
|
||||||
def load_links(itemlist, re_txt, color, desc_txt, quality=""):
|
def load_links(itemlist, re_txt, color, desc_txt, quality=""):
|
||||||
streaming = scrapertoolsV2.find_single_match(data, re_txt)
|
streaming = scrapertoolsV2.find_single_match(data, re_txt).replace('"','')
|
||||||
patron = '<td><a[^h]href="([^"]+)"[^>]+>([^<]+)<'
|
logger.info('STREAMING='+streaming)
|
||||||
|
patron = '<td><a[^h]href=(.*?) target[^>]+>([^<]+)<'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(streaming)
|
matches = re.compile(patron, re.DOTALL).findall(streaming)
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
|
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
|
||||||
@@ -338,6 +336,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
# Carica la pagina
|
# Carica la pagina
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
logger.info("DATA= "+data)
|
||||||
|
|
||||||
# Extract the quality format
|
# Extract the quality format
|
||||||
patronvideos = '>([^<]+)</strong></div>'
|
patronvideos = '>([^<]+)</strong></div>'
|
||||||
@@ -347,21 +346,21 @@ def findvideos(item):
|
|||||||
QualityStr = scrapertoolsV2.decodeHtmlentities(match.group(1))[6:]
|
QualityStr = scrapertoolsV2.decodeHtmlentities(match.group(1))[6:]
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming
|
# Estrae i contenuti - Streaming
|
||||||
load_links(itemlist, '<strong>Streaming:</strong>(.*?)<table class="cbtable" height="30">', "orange", "Streaming", "SD")
|
load_links(itemlist, '<strong>Streaming:</strong>(.*?)<table class=cbtable height=30>', "orange", "Streaming", "SD")
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming HD
|
# Estrae i contenuti - Streaming HD
|
||||||
load_links(itemlist, '<strong>Streaming HD[^<]+</strong>(.*?)<table class="cbtable" height="30">', "yellow", "Streaming HD", "HD")
|
load_links(itemlist, '<strong>Streaming HD[^<]+</strong>(.*?)<table class=cbtable height=30>', "yellow", "Streaming HD", "HD")
|
||||||
|
|
||||||
autoplay.start(itemlist, item)
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming 3D
|
# Estrae i contenuti - Streaming 3D
|
||||||
load_links(itemlist, '<strong>Streaming 3D[^<]+</strong>(.*?)<table class="cbtable" height="30">', "pink", "Streaming 3D")
|
load_links(itemlist, '<strong>Streaming 3D[^<]+</strong>(.*?)<table class=cbtable height=30>', "pink", "Streaming 3D")
|
||||||
|
|
||||||
# Estrae i contenuti - Download
|
# Estrae i contenuti - Download
|
||||||
load_links(itemlist, '<strong>Download:</strong>(.*?)<table class="cbtable" height="30">', "aqua", "Download")
|
load_links(itemlist, '<strong>Download:</strong>(.*?)<table class=cbtable height=30>', "aqua", "Download")
|
||||||
|
|
||||||
# Estrae i contenuti - Download HD
|
# Estrae i contenuti - Download HD
|
||||||
load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<table class="cbtable" width="100%" height="20">', "azure",
|
load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<table class=cbtable width=100% height=20>', "azure",
|
||||||
"Download HD")
|
"Download HD")
|
||||||
|
|
||||||
if len(itemlist) == 0:
|
if len(itemlist) == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user