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
+17 -7
View File
@@ -6,6 +6,7 @@ import requests, re
from core import support, tmdb from core import support, tmdb
from core.item import Item from core.item import Item
from specials import autorenumber from specials import autorenumber
from lib.concurrent import futures
__channel__ = "vvvvid" __channel__ = "vvvvid"
host = support.config.get_channel_url(__channel__) host = support.config.get_channel_url(__channel__)
@@ -87,19 +88,28 @@ def newest(categoria):
item.contentType = 'tvshow' item.contentType = 'tvshow'
item.url = host + 'anime/' item.url = host + 'anime/'
return peliculas(item) 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): def peliculas(item):
itemlist = [] itemlist = []
if not item.args: if not item.args:
json_file = current_session.get(item.url + 'channels', headers=headers, params=payload).json() 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] names = [i['filter'] for i in json_file['data'] if 'filter' in i][0]
for name in names: with futures.ThreadPoolExecutor() as executor:
url = item.url + 'channel/10003/last/?filter=' + str(name) json_file = [executor.submit(dl_pages, name, item,) for name in names]
json_file = current_session.get(url, headers=headers, params=payload).json() for res in futures.as_completed(json_file):
if 'data' in json_file: if res.result():
json_file = current_session.get(url, headers=headers, params=payload).json() itemlist += res.result()
make_itemlist(itemlist, item, json_file) itemlist = sorted(itemlist, key=lambda it: it.fulltitle)
elif ('=' not in item.args) and ('=' not in item.url): elif ('=' not in item.args) and ('=' not in item.url):
json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json() json_file = current_session.get(item.url + item.args, headers=headers, params=payload).json()
+2 -2
View File
@@ -271,7 +271,7 @@ def channel_search(item):
ch_thumb = channeltools.get_channel_parameters(key)['thumbnail'] ch_thumb = channeltools.get_channel_parameters(key)['thumbnail']
results.append(Item(channel='search', title=title, 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)) 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) # send_to_temp(to_temp)
@@ -279,7 +279,7 @@ def channel_search(item):
if item.mode == 'all': if item.mode == 'all':
if config.get_setting('result_mode', 'search') != 0: if config.get_setting('result_mode', 'search') != 0:
res_count = len(results) 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_statistic = config.get_localized_string(59972) % (item.title, res_count, time.time() - start)
results.insert(0, Item(title = typo(results_statistic,'color kod bold'))) results.insert(0, Item(title = typo(results_statistic,'color kod bold')))
# logger.debug(results_statistic) # logger.debug(results_statistic)