Encode URL before sending to tny.im.

This commit is contained in:
Arun Prakash Jana 2017-01-11 05:23:24 +05:30
parent 16f4ad2b38
commit bc65e17782
No known key found for this signature in database
GPG Key ID: A75979F35C080412

View File

@ -1471,7 +1471,9 @@ Buku bookmarks</H3>
urlbase = 'https://tny.im/yourls-api.php?action='
if shorten:
_u = '%s%s%s' % (urlbase, 'shorturl&format=simple&url=', url)
from urllib.parse import quote_plus as qp
_u = '%s%s%s' % (urlbase, 'shorturl&format=simple&url=', qp(url))
else:
_u = '%s%s%s' % (urlbase, 'expand&format=simple&shorturl=', url)