Fix AnimeSaturn e serverWindow
This commit is contained in:
@@ -175,7 +175,6 @@ def findvideos(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
links = []
|
||||
|
||||
main_url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
||||
urls = support.match(support.match(main_url, headers=headers).data, patron=r'<a class="dropdown-item"\s*href="([^"]+)', headers=headers).matches
|
||||
itemlist.append(item.clone(action="play", title='Primario', url=main_url, server='directo'))
|
||||
@@ -186,6 +185,11 @@ def findvideos(item):
|
||||
links.append(link)
|
||||
return support.server(item, data=links, itemlist=itemlist)
|
||||
|
||||
def play(item):
|
||||
if item.server == 'directo':
|
||||
item.url = support.match(item.url, patron=r'(?:source type="[^"]+"\s*src=|file:[^"]+)"([^"]+)').match
|
||||
return[item]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ class scrape:
|
||||
if config.get_setting('trakt_sync'):
|
||||
from core import trakt_tools
|
||||
trakt_tools.trakt_check(self.itemlist)
|
||||
logger.debug('scraping time: ', time()-scrapingTime)
|
||||
logger.debug(item.channel, 'scraping time:', time()-scrapingTime)
|
||||
|
||||
def _scrapeBlock(self, item, block):
|
||||
itemlist = []
|
||||
@@ -1046,7 +1046,8 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
video_urls= videoitem.video_urlsn,
|
||||
ch_name=channeltools.get_channel_parameters(item.channel)['title'],
|
||||
action = "play")
|
||||
if videoitem.title: vi.serverName = videoitem.serverName
|
||||
|
||||
if videoitem.title: vi.serverName = videoitem.title
|
||||
if videoitem.quality: vi.quality = videoitem.quality
|
||||
if not vi.referer: vi.referer = item.url
|
||||
if videoitem.contentType == 'episode': vi.fanart=videoitem.thumbnail
|
||||
@@ -1073,16 +1074,16 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
|
||||
# non threaded for webpdb
|
||||
# dbg()
|
||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
# for it in thL:
|
||||
# if it and not config.get_setting("black_list", server=it.server.lower()):
|
||||
# verifiedItemlist.append(it)
|
||||
thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
for it in thL:
|
||||
if it and not config.get_setting("black_list", server=it.server.lower()):
|
||||
verifiedItemlist.append(it)
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
for it in futures.as_completed(thL):
|
||||
if it.result():
|
||||
verifiedItemlist.append(it.result())
|
||||
# with futures.ThreadPoolExecutor() as executor:
|
||||
# thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
# for it in futures.as_completed(thL):
|
||||
# if it.result():
|
||||
# verifiedItemlist.append(it.result())
|
||||
|
||||
if patronTag:
|
||||
addQualityTag(item, verifiedItemlist, data, patronTag)
|
||||
|
||||
@@ -1849,10 +1849,7 @@ def serverwindow(item, itemlist):
|
||||
quality = ' [' + videoitem.quality + ']' if videoitem.quality else ''
|
||||
if videoitem.server:
|
||||
color = scrapertools.find_single_match(videoitem.alive, r'(FF[^\]]+)')
|
||||
path = filetools.join(config.get_runtime_path(), 'servers', videoitem.server.lower() + '.json')
|
||||
name = jsontools.load(open(path, "rb").read())['name']
|
||||
if name.startswith('@'): name = config.get_localized_string(int(name.replace('@','')))
|
||||
it = xbmcgui.ListItem('{}{}'.format(name, quality))
|
||||
it = xbmcgui.ListItem('{}{}'.format(videoitem.serverName, quality))
|
||||
|
||||
# format Title
|
||||
if self.item.contentSeason and self.item.contentEpisodeNumber:
|
||||
|
||||
@@ -70,8 +70,12 @@ def run_threaded(job_func, args):
|
||||
|
||||
|
||||
def join_threads():
|
||||
logger.debug(threads)
|
||||
for th in threads:
|
||||
try:
|
||||
th.join()
|
||||
except:
|
||||
logger.error(traceback.format_exc())
|
||||
|
||||
|
||||
class AddonMonitor(xbmc.Monitor):
|
||||
|
||||
Reference in New Issue
Block a user