diff options
Diffstat (limited to 'app/links/models.py')
-rw-r--r-- | app/links/models.py | 9 |
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 |