Rimossi alcuni log in Community

This commit is contained in:
Alhaziel01
2020-11-26 17:04:21 +01:00
parent 288af804e7
commit 22f4e80783
+22 -23
View File
@@ -6,7 +6,7 @@ import re, inspect, xbmcgui
from core import httptools, jsontools, tmdb, support, filetools from core import httptools, jsontools, tmdb, support, filetools
from core.item import Item from core.item import Item
from platformcode import config, platformtools from platformcode import config, platformtools, logger
from channelselector import get_thumb from channelselector import get_thumb
from collections import OrderedDict from collections import OrderedDict
@@ -25,7 +25,7 @@ list_quality = ['SD', '720', '1080', '4k']
tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228' tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228'
def mainlist(item): def mainlist(item):
support.info() logger.debug()
path = filetools.join(config.get_data_path(), 'community_channels.json') path = filetools.join(config.get_data_path(), 'community_channels.json')
if not filetools.exists(path): if not filetools.exists(path):
@@ -37,7 +37,7 @@ def mainlist(item):
def show_channels(item): def show_channels(item):
support.info() logger.debug()
itemlist = [] itemlist = []
# add context menu # add context menu
@@ -77,7 +77,7 @@ def show_channels(item):
def show_menu(item): def show_menu(item):
support.info() logger.debug()
itemlist = [] itemlist = []
@@ -116,12 +116,12 @@ def show_menu(item):
if 'channel_name' in json and not 'disable_search' in json and 'search' not in json: if 'channel_name' in json and not 'disable_search' in json and 'search' not in json:
itemlist += get_search_menu(item, json, channel_name=json['channel_name']) itemlist += get_search_menu(item, json, channel_name=json['channel_name'])
support.info('PAGINATION:', disable_pagination) logger.debug('PAGINATION:', disable_pagination)
return itemlist return itemlist
def search(item, text): def search(item, text):
support.info(text) logger.info('search',text)
itemlist = [] itemlist = []
if item.custom_search: if item.custom_search:
@@ -170,7 +170,7 @@ def global_search(item, text):
def peliculas(item, json='', key='', itemlist=[]): def peliculas(item, json='', key='', itemlist=[]):
item.plot = item.thumb = item.fanart ='' item.plot = item.thumb = item.fanart =''
support.info('PAGINATION:', item.disable_pagination) logger.debug('PAGINATION:', item.disable_pagination)
if not json: if not json:
key = item.key key = item.key
json = load_json(item)[key] json = load_json(item)[key]
@@ -241,7 +241,7 @@ def peliculas(item, json='', key='', itemlist=[]):
def get_seasons(item): def get_seasons(item):
support.info() logger.debug()
itemlist = [] itemlist = []
infoLabels = item.infoLabels infoLabels = item.infoLabels
json = item.url if type(item.url) == dict else item.url json = item.url if type(item.url) == dict else item.url
@@ -281,7 +281,7 @@ def get_seasons(item):
def episodios(item, json ='', key='', itemlist =[]): def episodios(item, json ='', key='', itemlist =[]):
support.info() logger.debug()
infoLabels = item.infoLabels infoLabels = item.infoLabels
itm=item itm=item
@@ -394,7 +394,7 @@ def episodios(item, json ='', key='', itemlist =[]):
# Find Servers # Find Servers
def findvideos(item): def findvideos(item):
support.info() logger.debug()
itemlist = [] itemlist = []
if 'links' in item.url: if 'links' in item.url:
json = item.url['links'] json = item.url['links']
@@ -414,7 +414,7 @@ def findvideos(item):
################################ Menu ################################ ################################ Menu ################################
def get_menu(item, json, key, itemlist=[]): def get_menu(item, json, key, itemlist=[]):
support.info() logger.debug()
json = json[key] json = json[key]
for option in json: for option in json:
title = option['title'] if 'title' in option else json[option] if 'search' not in option else '' title = option['title'] if 'title' in option else json[option] if 'search' not in option else ''
@@ -449,7 +449,7 @@ def get_menu(item, json, key, itemlist=[]):
def get_sub_menu(item, json, key, itemlist=[]): def get_sub_menu(item, json, key, itemlist=[]):
support.info() logger.debug()
json = json[key] json = json[key]
search = False search = False
if item.menu: if item.menu:
@@ -488,7 +488,7 @@ def get_sub_menu(item, json, key, itemlist=[]):
def get_search_menu(item, json='', itemlist=[], channel_name=''): def get_search_menu(item, json='', itemlist=[], channel_name=''):
support.info() logger.debug()
if 'title' in json: if 'title' in json:
title = json['title'] title = json['title']
elif channel_name: elif channel_name:
@@ -514,7 +514,7 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''):
def submenu(item, json, key, itemlist = [], filter_list = []): def submenu(item, json, key, itemlist = [], filter_list = []):
support.info(item) logger.debug(item)
import sys import sys
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
from concurrent import futures from concurrent import futures
@@ -585,7 +585,6 @@ def filter_thread(filter, key, item, description):
if id: if id:
thumbnail = 'https://image.tmdb.org/t/p/original' + results['profile_path'] if results['profile_path'] else item.thumbnail thumbnail = 'https://image.tmdb.org/t/p/original' + results['profile_path'] if results['profile_path'] else item.thumbnail
json_file = httptools.downloadpage('http://api.themoviedb.org/3/person/'+ str(id) + '?api_key=' + tmdb_api + '&language=en', use_requests=True).data json_file = httptools.downloadpage('http://api.themoviedb.org/3/person/'+ str(id) + '?api_key=' + tmdb_api + '&language=en', use_requests=True).data
support.info(json_file)
plot += jsontools.load(json_file)['biography'] plot += jsontools.load(json_file)['biography']
if description: if description:
@@ -620,7 +619,7 @@ def filter_thread(filter, key, item, description):
# for load json from item or url # for load json from item or url
def load_json(item, no_order=False): def load_json(item, no_order=False):
support.info() logger.debug()
if type(item) == Item: if type(item) == Item:
url = item.url url = item.url
filterkey = item.filterkey filterkey = item.filterkey
@@ -645,7 +644,7 @@ def load_json(item, no_order=False):
# Load Channels json and check that the paths and channel titles are correct # Load Channels json and check that the paths and channel titles are correct
def load_and_check(item): def load_and_check(item):
support.info() logger.debug()
path = filetools.join(config.get_data_path(), 'community_channels.json') path = filetools.join(config.get_data_path(), 'community_channels.json')
file = open(path, "r") file = open(path, "r")
json = jsontools.load(file.read()) json = jsontools.load(file.read())
@@ -667,7 +666,7 @@ def load_and_check(item):
# set extra values # set extra values
def set_extra_values(item, json, path): def set_extra_values(item, json, path):
support.info() logger.debug()
ret = Item() ret = Item()
for key in json: for key in json:
if key == 'quality': if key == 'quality':
@@ -713,7 +712,7 @@ def set_extra_values(item, json, path):
# format titles # format titles
def set_title(title, language='', quality=''): def set_title(title, language='', quality=''):
support.info() logger.debug()
t = support.match(title, patron=r'\{([^\}]+)\}').match t = support.match(title, patron=r'\{([^\}]+)\}').match
if 'bold' not in t: t += ' bold' if 'bold' not in t: t += ' bold'
@@ -734,7 +733,7 @@ def set_title(title, language='', quality=''):
# for relative path # for relative path
def relative(key, json, path): def relative(key, json, path):
support.info() logger.debug()
ret = '' ret = ''
if key in json: if key in json:
if key in ['thumbnail', 'poster']: if key in ['thumbnail', 'poster']:
@@ -746,7 +745,7 @@ def relative(key, json, path):
def pagination(item, itemlist = []): def pagination(item, itemlist = []):
support.info() logger.debug()
itlist = [] itlist = []
if not itemlist: if not itemlist:
@@ -786,7 +785,7 @@ def pagination(item, itemlist = []):
return itlist return itlist
def add_channel(item): def add_channel(item):
support.info() logger.debug()
channel_to_add = {} channel_to_add = {}
json_file = '' json_file = ''
result = platformtools.dialog_select(config.get_localized_string(70676), [config.get_localized_string(70678), config.get_localized_string(70679)]) result = platformtools.dialog_select(config.get_localized_string(70676), [config.get_localized_string(70678), config.get_localized_string(70679)])
@@ -840,7 +839,7 @@ def add_channel(item):
return return
def remove_channel(item): def remove_channel(item):
support.info() logger.debug()
path = filetools.join(config.get_data_path(), 'community_channels.json') path = filetools.join(config.get_data_path(), 'community_channels.json')