commit 9e2be7556675126c769fb878b67b9415a4e0b945 Author: manfromhuh Date: Tue Jul 19 15:37:12 2022 -0400 It's done. diff --git a/url_decode.py b/url_decode.py new file mode 100755 index 0000000..baaaaf8 --- /dev/null +++ b/url_decode.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# A simple tool to parse urlsafe strings and return them to URL format. + +# imports +import argparse +import sys +from urllib.parse import * + +version = "2022.07.19" +cmd_args = argparse.ArgumentParser(description='Set urlsafe stirngs back to regularly formatted URLs.') +cmd_args.add_argument('--version', '-v', dest='print_version', action='store_true', + help='Print the current version number.') +cmd_args.add_argument('safe_string', type=str, nargs='?', default=" ", help="The string to convert from urlsafe to a URL."); +args = cmd_args.parse_args() + +if args.print_version: + print("Script version: " + version) + sys.exit() +else: + print(unquote(args.safe_string, encoding='utf-8', errors='replace'))