diff options
author | Hygna <hygna@proton.me> | 2022-10-06 08:29:34 +0100 |
---|---|---|
committer | Hygna <hygna@proton.me> | 2022-10-06 08:29:34 +0100 |
commit | c0b93130f00fbef01e89d3318a68bc56e1e347ed (patch) | |
tree | 8621b60e28390ee42138cea9198409c3144ece58 /src/instances | |
parent | Added support for i.stack.imgur.com and rimgo embeds (diff) | |
download | libredirect-c0b93130f00fbef01e89d3318a68bc56e1e347ed.zip |
Fixed Libreddit and LibreX instance fetching
Diffstat (limited to 'src/instances')
-rw-r--r-- | src/instances/get_instances.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |