def parse_spotify_url(url):
    """
    Parse the provided Spotify playlist URL and determine if it is a playlist, track or album.
    :param url: URL to be parsed

    :return tuple indicating the type and id of the item
    """
    if url.startswith("spotify:"):
        log.error("Spotify URI was provided instead of a playlist/album/track URL.")
        sys.exit(1)
    parsed_url = url.replace("https://open.spotify.com/", "").split("?")[0].split("/")
    index_adjustment = 1 if parsed_url[0].startswith("intl") else 0
    item_type = parsed_url[0+index_adjustment]
    item_id = parsed_url[1+index_adjustment]
    return item_type, item_id

    Parse the provided Spotify playlist URL and determine if it is a playlist, track or album.
    :param url: URL to be parsed

    :return tuple indicating the type and id of the item
    
spotify_dl/spotify.py