Encode/decode target URL with urlsafe functions.
This commit is contained in:
parent
0630e5f841
commit
35d85e05ab
1 changed files with 2 additions and 2 deletions
4
x.py
4
x.py
|
@ -89,7 +89,7 @@ def x(url):
|
||||||
# allow only one request at a time
|
# allow only one request at a time
|
||||||
with lock:
|
with lock:
|
||||||
durl = str.encode(url)
|
durl = str.encode(url)
|
||||||
durl = base64.b64decode(durl)
|
durl = base64.urlsafe_b64decode(durl)
|
||||||
durl = zlib.decompress(durl)
|
durl = zlib.decompress(durl)
|
||||||
aes = aes_new()
|
aes = aes_new()
|
||||||
durl = aes.decrypt(durl)
|
durl = aes.decrypt(durl)
|
||||||
|
@ -134,7 +134,7 @@ if __name__ == "__main__":
|
||||||
foo = str.encode(sys.argv[2])
|
foo = str.encode(sys.argv[2])
|
||||||
foo = aes.encrypt(foo)
|
foo = aes.encrypt(foo)
|
||||||
foo = zlib.compress(foo)
|
foo = zlib.compress(foo)
|
||||||
foo = base64.b64encode(foo)
|
foo = base64.urlsafe_b64encode(foo)
|
||||||
stdout_write(foo)
|
stdout_write(foo)
|
||||||
print()
|
print()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue