diff --git a/plugins/urlparse.py b/plugins/urlparse.py index b4f47d5..5fc63dc 100755 --- a/plugins/urlparse.py +++ b/plugins/urlparse.py @@ -8,7 +8,7 @@ def get_title(url): url = urlnorm.normalize(url.encode('utf-8')) url = url.decode('utf-8') # add http if its missing - if not url.startswith("http"): + if not "://" in url: url = "http://" + url try: # get the title diff --git a/plugins/util/web.py b/plugins/util/web.py index 1c550b5..f3d9700 100755 --- a/plugins/util/web.py +++ b/plugins/util/web.py @@ -14,9 +14,7 @@ class ShortenError(Exception): def bitly(url, user, api_key): """ shortens a URL with the bit.ly API """ - if url[:8] == "https://": - pass - elif url[:7] != "http://": + if not "://" in url: url = "http://" + url params = urlencode({'longUrl': url, 'login': user, 'apiKey': api_key, 'format': 'json'})