This is a Python port of the JavaScript mdurl package.