python module to get the base url from a url string using a third level domain .txt document and another trick