aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/tasks/forumtasks.py18
-rw-r--r--requirements.txt3
2 files changed, 15 insertions, 6 deletions
diff --git a/app/tasks/forumtasks.py b/app/tasks/forumtasks.py
index 85d4b09..9b200fc 100644
--- a/app/tasks/forumtasks.py
+++ b/app/tasks/forumtasks.py
@@ -99,11 +99,19 @@ def parseTitle(title):
def getLinksFromModSearch():
links = {}
- contents = urllib.request.urlopen("https://krock-works.uk.to/minetest/modList.php").read().decode("utf-8")
- for x in json.loads(contents):
- link = x.get("link")
- if link is not None:
- links[int(x["topicId"])] = link
+ try:
+ contents = urllib.request.urlopen("https://krock-works.uk.to/minetest/modList.php").read().decode("utf-8")
+ for x in json.loads(contents):
+ try:
+ link = x.get("link")
+ if link is not None:
+ links[int(x["topicId"])] = link
+ except ValueError:
+ pass
+
+ except urllib.error.URLError:
+ print("Unable to open krocks mod search!")
+ return links
return links
diff --git a/requirements.txt b/requirements.txt
index 10ef92e..7926abd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,7 +12,8 @@ GitHub-Flask~=3.2
SQLAlchemy-Searchable==1.0.3
beautifulsoup4~=4.6
-celery~=4.2
+celery==4.1.1
+kombu==4.2.0
GitPython~=2.1
lxml~=4.2
pillow~=5.3