def right_remove(text, to_remove):
    """ Removes a part of a string, if it ends with it.
        str.rstrip is similar, but can remove too much. 
        For example, '4.mp4'.rstrip('.mp4') will remove the leading four!
        This function does not do that.
    """
    if text.endswith(to_remove):
        return text[:len(text)-len(to_remove)]
    else:
        return text