Skip to content

Commit 6c85375

Browse files
committed
url encode every char when string start with all:
1 parent 7fcb187 commit 6c85375

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def de_int(s):
128128
def en_url(s):
129129
todo = ["!", "#", "$", "&", "'",
130130
"(", ")", "*", "+", ",", "/", ":", ";", "=", "?", "@", "[", "]", " "]
131-
return ''.join([i if i not in todo else "%" + hex(ord(i))[2:] for i in s])
131+
if not s.startswith("all:"):
132+
return ''.join([i if i not in todo else "%" + hex(ord(i))[2:].zfill(2) for i in s])
133+
else:
134+
return ''.join(["%" + hex(ord(i))[2:].zfill(2) for i in s[4:]])
132135

133136

134137
def de_url(s):

functions.pyc

9.97 KB
Binary file not shown.

0 commit comments

Comments
 (0)