diff --git a/plugins/util/web.py b/plugins/util/web.py index 336747d..3f072d5 100755 --- a/plugins/util/web.py +++ b/plugins/util/web.py @@ -32,6 +32,13 @@ def isgd(url): return request["shorturl"] +def try_isgd(url): + try: + out = isgd(url) + except (ShortenError, http.HTTPError): + out = url + return out + def haste(text, ext='txt'): """ pastes text to a hastebin server """ page = http.get(paste_url + "/documents", post_data=text)