Update spotify.py
This commit is contained in:
parent
4a04feff11
commit
9c95dd6590
1 changed files with 17 additions and 17 deletions
|
@ -10,11 +10,8 @@ spotify_re = (r'(spotify:(track|album|artist|user):([a-zA-Z0-9]+))', re.I)
|
||||||
http_re = (r'(open\.spotify\.com\/(track|album|artist|user)\/'
|
http_re = (r'(open\.spotify\.com\/(track|album|artist|user)\/'
|
||||||
'([a-zA-Z0-9]+))', re.I)
|
'([a-zA-Z0-9]+))', re.I)
|
||||||
|
|
||||||
def sptfy(inp):
|
def sptfy(inp, sptfy=False):
|
||||||
# try:
|
if sptfy:
|
||||||
# login = http.get("http://sptfy.com/login.php", post_data=urlencode({'loginUsername': 'xDCloudBot', 'loginPassword': 'rjgw67kf', 'submit': '', 'submitme': '1'}), cookies=True)
|
|
||||||
# except Exception as e:
|
|
||||||
# return inp
|
|
||||||
shortenurl = "http://sptfy.com/index.php"
|
shortenurl = "http://sptfy.com/index.php"
|
||||||
data = urlencode({'longUrl': inp, 'shortUrlDomain': 1, 'submitted': 1, "shortUrlFolder": 6, "customUrl": "", "shortUrlPassword": "", "shortUrlExpiryDate": "", "shortUrlUses": 0, "shortUrlType": 0})
|
data = urlencode({'longUrl': inp, 'shortUrlDomain': 1, 'submitted': 1, "shortUrlFolder": 6, "customUrl": "", "shortUrlPassword": "", "shortUrlExpiryDate": "", "shortUrlUses": 0, "shortUrlType": 0})
|
||||||
try:
|
try:
|
||||||
|
@ -27,6 +24,9 @@ def sptfy(inp):
|
||||||
except:
|
except:
|
||||||
message = "Unable to shorten URL: %s" % soup.find('div', {'class': 'messagebox_text'}).find('p').text.split("<br/>")[0]
|
message = "Unable to shorten URL: %s" % soup.find('div', {'class': 'messagebox_text'}).find('p').text.split("<br/>")[0]
|
||||||
return message
|
return message
|
||||||
|
else:
|
||||||
|
return web.try_isgd(inp)
|
||||||
|
|
||||||
|
|
||||||
@hook.command('sptrack')
|
@hook.command('sptrack')
|
||||||
@hook.command
|
@hook.command
|
||||||
|
|
Reference in a new issue