Toggle Navigation
Hatchery
Eggs
cccamp19
dirtyurl.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
dirtyurl.py
raw
Content
# Dirty URL encode replacements = {'%': "%25", ' ': "%20", '!': "%21", '"': "%22", '#': "%23", '$': "%24", '&': "%26", '\'': "%27", '(': "%28", ')': "%29", '*': "%2A", '+': "%2B", ',': "%2C", '-': "%2D", '.': "%2E", '/': "%2F", ':': "%3A", ';': "%3B", '<': "%3C", '=': "%3D", '>': "%3E", '?': "%3F", '@': "%40", '[': "%5B", '\\': "%5C", ']': "%5D", '^': "%5E", '_': "%5F", '`': "%60", '{': "%7B", '|': "%7C", '}': "%7D", '~': "%7E"} def encode(str): return "".join([replacements.get(c, c) for c in str])