KoD 1.6.1
-Migliorata l'efficacia del riconoscimento dei contenuti in ricerca film/serie - corretti alcuni bug e fatti alcuni fix per i soliti cambi di struttura
This commit is contained in:
@@ -10,14 +10,7 @@ typo = support.typo
|
||||
session = requests.Session()
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
def getToken():
|
||||
token = config.get_setting('token', 'discoveryplus', None)
|
||||
if not token:
|
||||
token = session.get('https://disco-api.discoveryplus.it/token?realm=dplayit').json()['data']['attributes']['token']
|
||||
config.set_setting('token', token, 'discoveryplus')
|
||||
return token
|
||||
|
||||
token = getToken()
|
||||
token = session.get('https://disco-api.discoveryplus.it/token?realm=dplayit').json()['data']['attributes']['token']
|
||||
|
||||
api = "https://disco-api.discoveryplus.it"
|
||||
headers = {'User-Agent': 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
|
||||
@@ -70,7 +63,7 @@ def live(item):
|
||||
logger.debug()
|
||||
itemlist =[]
|
||||
for name, values in liveDict().items():
|
||||
itemlist.append(item.clone(title=typo(name), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True))
|
||||
itemlist.append(item.clone(title=typo(name,'bold'), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True))
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ def play(item):
|
||||
data = support.match(sec_data, patron=r'<video src="([^"]+)').match
|
||||
break
|
||||
else:
|
||||
support.dbg()
|
||||
# support.dbg()
|
||||
data = url
|
||||
|
||||
return support.servertools.find_video_items(item, data=data)
|
||||
|
||||
@@ -88,7 +88,7 @@ def peliculas(item):
|
||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)(?:\s(?P<year>\d{4})|<)'
|
||||
patronBlock = r'Lista dei film disponibili in streaming e anche in download\.</p>(?P<block>.*?)<div class="footer_c">'
|
||||
else:
|
||||
patron = r'<tr><td><a href="(?P<url>[^"]+)"(?:|.+?)?>(?: )?[ ]?(?P<title>.*?)[ ]?(?P<quality>HD)?[ ]?(?P<year>\d+)?(?: | HD | Streaming | MD(?: iSTANCE)? )?</a>'
|
||||
patron = r'<tr><td><a href="(?P<url>[^"]+)"(?:|.+?)?>(?: )?[ ]?(?P<title>.*?)[ ]?(?P<quality>HD)?[ ]?(?P<year>\d+)?(?: | HD[^<]*| Streaming[^<]*| MD(?: iSTANCE)? [^<]*)?</a>'
|
||||
|
||||
def itemHook(item):
|
||||
if 'film' in item.url:
|
||||
|
||||
+13
-26
@@ -5,17 +5,11 @@
|
||||
|
||||
from core import support
|
||||
import sys
|
||||
if sys.version_info[0] >= 3: from concurrent import futures
|
||||
else: from concurrent_py2 import futures
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
@@ -33,22 +27,10 @@ def search(item, text):
|
||||
support.info(text)
|
||||
# item.args='search'
|
||||
item.text = text
|
||||
itemlist = []
|
||||
itlist = []
|
||||
item.url = item.url + '/?%73=' + text.replace(' ', '+')
|
||||
|
||||
try:
|
||||
# item.url = host + '/lista-serie-tv/'
|
||||
# item.contentType = 'tvshow'
|
||||
# itemlist += peliculas(item)
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
for par in [['/serie-tv/', 'tvshow', ''],['/anime/', 'tvshow', ''], ['/-anime-sub-ita/', 'tvshow', 'sub'], ['/film-animazione/', 'movie', '']]:
|
||||
item.url = host + par[0]
|
||||
item.contentType = par[1]
|
||||
item.args = par[2]
|
||||
itlist.append(executor.submit(peliculas, item))
|
||||
for res in futures.as_completed(itlist):
|
||||
itemlist += res.result()
|
||||
return itemlist
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -75,21 +57,26 @@ def newest(categoria):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
search = item.text
|
||||
# debugBlock = True
|
||||
# debug = True
|
||||
# search = item.text
|
||||
if item.contentType != 'movie': anime = True
|
||||
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
|
||||
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
||||
|
||||
if search:
|
||||
if item.action == 'search':
|
||||
pagination = ''
|
||||
patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
|
||||
patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
||||
#patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
|
||||
patronBlock = '<main[^>]+>(?P<block>.*?)</ma'
|
||||
#patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<[^>]+>[^>]+><div'
|
||||
elif item.args == 'last':
|
||||
patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>'
|
||||
patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src(?:set)?="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)'
|
||||
patron = r'<a href="(?P<url>[^"]+)">\s*<img[^>]+src[set]{0,3}="(?P<thumbnail>[^ ]+)[^>]+>\s*<span[^>]+>(?P<title>[^<]+)'
|
||||
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>[^"]+)" 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))'
|
||||
typeContentDict={'movie':['film']}
|
||||
typeActionDict={'findvideos':['film']}
|
||||
patronNext = '<a class="next page-numbers" href="([^"]+)">'
|
||||
|
||||
Reference in New Issue
Block a user