From c0b93130f00fbef01e89d3318a68bc56e1e347ed Mon Sep 17 00:00:00 2001 From: Hygna Date: Thu, 6 Oct 2022 08:29:34 +0100 Subject: Fixed Libreddit and LibreX instance fetching --- src/instances/get_instances.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/instances') diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index fc730cf6..f0fa8496 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -141,6 +141,8 @@ def fetchJsonList(frontend, name, url, urlItem, jsonObject): try: r = requests.get(url) rJson = json.loads(r.text) + if jsonObject: + rJson = rJson['instances'] _list = {} for network in config['networks']: _list[network] = [] @@ -148,12 +150,10 @@ def fetchJsonList(frontend, name, url, urlItem, jsonObject): for item in rJson: for network in config['networks']: if urlItem[network] is not None: - if urlItem[network] in item: + if urlItem[network] in item and item[urlItem[network]] is not None: if item[urlItem[network]].strip() != '': _list[network].append(item[urlItem[network]]) else: - if jsonObject: - rJson = rJson['instances'] for item in rJson: tmpItem = item if urlItem is not None: -- cgit 1.4.1