def _get_token(rclone_config_file: str):
    """ Extract token from file (rclone config or plain file) """
    with open(rclone_config_file) as f:
        content = f.read()

    token = None

    for line in content.splitlines():
        # try rclone config file
        if line.startswith("bearer_token"):
            token = line.split()[-1]

    if token is None:
        # assume plain text file
        token = content.strip()
    return token