def clean_url(url: str) -> str:
    """ 
    Removes unwanted characters from the end of certain URLs. 
    
    Args:
        url (:obj:`str`):
            A URL.
    
    Returns:
        :obj:`str`:
            A URL without unwanted characters at the end.
    """
    if 'achgut' in url and '/P' in url:
        return url.rsplit('/P', 1)[0]
    if 'focus' in url:
        return url.rsplit('_id_', 1)[0]
    if 'sueddeutsche' in url and '1.508' in url:
        return url.rsplit('-', 1)[0]
    if 'opposition24' in url:
        return url.rsplit('/?', 1)[0]
    return url