def METHOD_NAME(uri):
    # some are sub pages of the shoutcast admin panel
    for subfix in [".html", ".php", ".cgi"]:
        if subfix in uri:
            return uri[:uri.rfind("/")+1]
    for s in ["%3Fsid%3D1"]:
        if uri.endswith(s):
            return uri[:-len(s)]
    return uri