summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/links/models.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/links/models.py b/app/links/models.py
index 45d9c09..d7e04c4 100644
--- a/app/links/models.py
+++ b/app/links/models.py
@@ -37,9 +37,12 @@ def random_link():
def get_source(source):
- url = "http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=json&u=%s" % (source)
- r = requests.get(url, timeout=15.001)
- data = r.json()
+ try:
+ url = "http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=json&u=%s" % (source)
+ r = requests.get(url, timeout=15.001)
+ data = r.json()
+ except:
+ data = ""
return data