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):
|
def bitly(url, user, apikey):
|
||||||
try:
|
try:
|
||||||
if url[:7] != "http://":
|
|
||||||
if url[:8] == "https://":
|
if url[:8] == "https://":
|
||||||
url = url
|
pass
|
||||||
|
elif url[:7] != "http://":
|
||||||
url = "http://" + url
|
url = "http://" + url
|
||||||
params = urlencode({'longUrl': url, 'login': user, 'apiKey': apikey, 'format': 'json'})
|
params = urlencode({'longUrl': url, 'login': user, 'apiKey': apikey, 'format': 'json'})
|
||||||
j = http.get_json("http://api.bit.ly/v3/shorten?%s" % params)
|
j = http.get_json("http://api.bit.ly/v3/shorten?%s" % params)
|
||||||
|
|
Reference in a new issue