If you work with strings in your Python scripts and you're writing obscure logic to process them, then you need to look into regex in Python. It lets you describe patterns instead of writing ...
This Python script converts AmneziaVPN configurations between Base64-encoded strings and JSON format. vpn://AAAGX..: The Base64-encoded string containing the AmneziaVPN configuration.-o output.json: ...