rimosso filter_servers
This commit is contained in:
@@ -118,8 +118,6 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
||||
|
||||
# We remove the deactivated servers
|
||||
# itemlist = filter(lambda i: not i.server or is_server_enabled(i.server), itemlist)
|
||||
# Filter if necessary
|
||||
itemlist = filter_servers(itemlist)
|
||||
|
||||
for item in itemlist:
|
||||
# We assign "direct" in case the server is not in KoD
|
||||
@@ -215,8 +213,6 @@ def get_server_from_url(url):
|
||||
for serverid in servers_list:
|
||||
'''if not is_server_enabled(serverid):
|
||||
continue'''
|
||||
if config.get_setting("filter_servers") == True and config.get_setting("black_list", server=serverid):
|
||||
continue
|
||||
serverid = get_server_name(serverid)
|
||||
if not serverid:
|
||||
continue
|
||||
@@ -721,33 +717,7 @@ def sort_servers(servers_list):
|
||||
return servers_list
|
||||
|
||||
|
||||
def filter_servers(servers_list):
|
||||
"""
|
||||
If the option "Filter by servers" is activated in the server configuration, removes the servers included in the Black List from the entry list.
|
||||
:param servers_list: List of servers to filter. The items in the servers_list can be strings or Item objects. In which case it is necessary that they have an item.server attribute of type str.
|
||||
:return: List of the same type of objects as servers_list filtered based on the Black List.
|
||||
"""
|
||||
# We eliminate the inactive
|
||||
if servers_list:
|
||||
servers_list = [i for i in servers_list if not i.server or is_server_enabled(i.server)]
|
||||
|
||||
|
||||
if servers_list and config.get_setting('filter_servers'):
|
||||
if isinstance(servers_list[0], Item):
|
||||
servers_list_filter = [x for x in servers_list if not config.get_setting("black_list", server=x.server)]
|
||||
else:
|
||||
servers_list_filter = [x for x in servers_list if not config.get_setting("black_list", server=x)]
|
||||
|
||||
# If there are no links after filtering
|
||||
if servers_list_filter or not platformtools.dialog_yesno(config.get_localized_string(60000), config.get_localized_string(60010), config.get_localized_string(70281)):
|
||||
servers_list = servers_list_filter
|
||||
|
||||
return servers_list
|
||||
|
||||
|
||||
|
||||
# Checking links
|
||||
|
||||
def check_list_links(itemlist, numero='', timeout=3):
|
||||
"""
|
||||
Check a list of video links and return it by modifying the title with verification.
|
||||
|
||||
@@ -208,7 +208,6 @@ def run(item=None):
|
||||
# First checks if channel has a "findvideos" function
|
||||
if hasattr(channel, 'findvideos'):
|
||||
itemlist = getattr(channel, item.action)(item)
|
||||
itemlist = servertools.filter_servers(itemlist)
|
||||
|
||||
# If not, uses the generic findvideos function
|
||||
else:
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
<setting id="httptools_timeout" type="slider" option="int" range="0,5,120" label="70580" default="15"/>
|
||||
<setting label="70145" type="lsep"/>
|
||||
<setting id="favorites_servers" type="bool" label="60551" default="false" visible="false"/>
|
||||
<setting id="filter_servers" type="bool" label="30068" default="false" visible="false"/>
|
||||
<setting id="quality_priority" type="bool" label="30069" default="false" visible="false"/>
|
||||
|
||||
<setting id="servers_config" type="action" label="60538" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19tZW51IiwNCiAgICAiY2hhbm5lbCI6ICJzaG9ydGN1dHMiDQp9==)"/>
|
||||
|
||||
@@ -288,10 +288,6 @@ def get_links(list_item, item, list_language, list_quality=None, global_filter_l
|
||||
|
||||
second_lang = config.get_setting('second_language')
|
||||
|
||||
# Sort by favorite servers, delete blacklist servers and disabled
|
||||
from core import servertools
|
||||
list_item= servertools.filter_servers(list_item)
|
||||
|
||||
logger.debug("total de items : %s" % len(list_item))
|
||||
|
||||
new_itemlist = []
|
||||
|
||||
@@ -586,7 +586,6 @@ def findvideos(item):
|
||||
if item_json.videolibray_emergency_urls:
|
||||
del item_json.videolibray_emergency_urls
|
||||
list_servers = getattr(channel, 'findvideos')(item_json)
|
||||
list_servers = servertools.filter_servers(list_servers)
|
||||
elif item_json.action == 'play':
|
||||
from platformcode import platformtools
|
||||
# autoplay.set_status(True)
|
||||
|
||||
Reference in New Issue
Block a user