Fixed (I hope) the same bug with https://
This commit is contained in:
parent
11c5005158
commit
6749bf8340
1 changed files with 3 additions and 3 deletions
|
@ -15,9 +15,9 @@ class ShortenError(Exception):
|
|||
|
||||
def bitly(url, user, apikey):
|
||||
try:
|
||||
if url[:7] != "http://":
|
||||
if url[:8] == "https://":
|
||||
url = url
|
||||
if url[:8] == "https://":
|
||||
pass
|
||||
elif url[:7] != "http://":
|
||||
url = "http://" + url
|
||||
params = urlencode({'longUrl': url, 'login': user, 'apiKey': apikey, 'format': 'json'})
|
||||
j = http.get_json("http://api.bit.ly/v3/shorten?%s" % params)
|
||||
|
|
Reference in a new issue