Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2019-12-21 16:47:37 +01:00
2 changed files with 19 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import requests, re
from core import support, tmdb
from core.item import Item
from specials import autorenumber
from lib.concurrent import futures
__channel__ = "vvvvid"
host = support.config.get_channel_url(__channel__)
@@ -87,19 +88,28 @@ def newest(categoria):
item.contentType = 'tvshow'
item.url = host + 'anime/'
return peliculas(item)
def dl_pages(name,item):
itemlist = []
url = item.url + 'channel/10003/last/?filter=' + str(name)
json_file = current_session.get(url, headers=headers, params=payload).json()
if 'data' in json_file:
json_file = current_session.get(url, headers=headers, params=payload).json()
make_itemlist(itemlist, item, json_file)
return itemlist
def peliculas(item):
itemlist = []
if not item.args:
json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json()
names = [i['filter'] for i in json_file['data'] if 'filter' in i][0]
for name in names:
url = item.url + 'channel/10003/last/?filter=' + str(name)
json_file = current_session.get(url, headers=headers, params=payload).json()
if 'data' in json_file:
json_file = current_session.get(url, headers=headers, params=payload).json()
make_itemlist(itemlist, item, json_file)
with futures.ThreadPoolExecutor() as executor:
json_file = [executor.submit(dl_pages, name, item,) for name in names]
for res in futures.as_completed(json_file):
if res.result():
itemlist += res.result()
itemlist = sorted(itemlist, key=lambda it: it.fulltitle)
elif ('=' not in item.args) and ('=' not in item.url):
json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json()

View File

@@ -271,7 +271,7 @@ def channel_search(item):
ch_thumb = channeltools.get_channel_parameters(key)['thumbnail']
results.append(Item(channel='search', title=title,
action='get_from_temp', thumbnail=ch_thumb, itemlist=[ris.tourl() for ris in grouped], plot=plot, page=1))
results = sorted(results, key=lambda it: it.from_channel)
# send_to_temp(to_temp)
@@ -279,7 +279,7 @@ def channel_search(item):
if item.mode == 'all':
if config.get_setting('result_mode', 'search') != 0:
res_count = len(results)
results = sorted(results, key=lambda it: it.title)
results = sorted(results, key=lambda it: it.title)
results_statistic = config.get_localized_string(59972) % (item.title, res_count, time.time() - start)
results.insert(0, Item(title = typo(results_statistic,'color kod bold')))
# logger.debug(results_statistic)