Decode escaped characters in URL

Official docs.

urllib.unquote(string)

Replace %xx escapes by their single-character equivalent.

Example: unquote('/%7Econnolly/') yields '/~connolly/'.

And then just decode.


Update: For Python 3, write the following:

import urllib.parse
urllib.parse.unquote(url)

Python 3 docs.


And if you are using Python3 you could use:

import urllib.parse
urllib.parse.unquote(url)