Community, usa relative link solo quando richiesto
This commit is contained in:
@@ -53,7 +53,7 @@ def show_channels(item):
|
|||||||
|
|
||||||
for key, channel in json['channels'].items():
|
for key, channel in json['channels'].items():
|
||||||
path = filetools.dirname(channel['path']) # relative path
|
path = filetools.dirname(channel['path']) # relative path
|
||||||
channel_json = load_json(channel['path']) # read channel json
|
channel_json = load_json(channel) # read channel json
|
||||||
|
|
||||||
# retrieve information from json
|
# retrieve information from json
|
||||||
thumbnail = relative('thumbnail', channel_json, path)
|
thumbnail = relative('thumbnail', channel_json, path)
|
||||||
@@ -63,7 +63,7 @@ def show_channels(item):
|
|||||||
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=support.typo(channel['channel_name'],'bold'),
|
title=support.typo(channel['channel_name'],'bold'),
|
||||||
url=channel['path'],
|
url=channel['url'],
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
fanart=fanart,
|
fanart=fanart,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
@@ -613,7 +613,7 @@ def load_json(item, no_order=False):
|
|||||||
url = item.url
|
url = item.url
|
||||||
filterkey = item.filterkey
|
filterkey = item.filterkey
|
||||||
else:
|
else:
|
||||||
url = item
|
url = item['url'] if 'url' in item else item
|
||||||
filterkey = ''
|
filterkey = ''
|
||||||
try:
|
try:
|
||||||
if url.startswith('http'):
|
if url.startswith('http'):
|
||||||
@@ -639,9 +639,10 @@ def load_and_check(item):
|
|||||||
json = jsontools.load(file.read())
|
json = jsontools.load(file.read())
|
||||||
|
|
||||||
for key, channel in json['channels'].items():
|
for key, channel in json['channels'].items():
|
||||||
if not 'checked' in channel:
|
if not 'check' in channel:
|
||||||
response = httptools.downloadpage(channel['path'], follow_redirects=True, timeout=5)
|
response = httptools.downloadpage(channel['path'], follow_redirects=True, timeout=5)
|
||||||
if response.success:
|
if response.success:
|
||||||
|
channel['url'] = channel['path']
|
||||||
channel['path'] = response.url
|
channel['path'] = response.url
|
||||||
channel['channel_name'] = re.sub(r'\[[^\]]+\]', '', channel['channel_name'])
|
channel['channel_name'] = re.sub(r'\[[^\]]+\]', '', channel['channel_name'])
|
||||||
channel['check'] = True
|
channel['check'] = True
|
||||||
|
|||||||
Reference in New Issue
Block a user