How to use the spotdl.youtube_tools function in spotdl

To help you get started, we’ve selected a few spotdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ritiek / spotify-downloader / test / test_youtube_tools.py View on Github external
def test_download_from_list_without_youtube_api(
        self, metadata_fixture, content_fixture
    ):
        const.args.youtube_api_key = None
        youtube_tools.set_api_key()
        content_fixture = youtube_tools.go_pafy(TRACK_SEARCH, metadata_fixture)
        title = youtube_tools.get_youtube_title(content_fixture, 1)
        assert title == "1. {0}".format(EXPECTED_TITLE)
github ritiek / spotify-downloader / test / test_youtube_tools.py View on Github external
def test_default(self):
        const.args.youtube_api_key = None
        youtube_tools.set_api_key()
        key = youtube_tools.pafy.g.api_key
        assert key == EXPECTED_YT_API_KEY
github ritiek / spotify-downloader / test / test_with_metadata.py View on Github external
def test_youtube_title():
    global content
    content = youtube_tools.go_pafy(TRACK_URL, meta_tags)
    title = youtube_tools.get_youtube_title(content)
    assert title == EXPECTED_YT_TITLE
github ritiek / spotify-downloader / test / test_youtube_tools.py View on Github external
def test_download_from_list_without_youtube_api(
        self, metadata_fixture, content_fixture
    ):
        const.args.youtube_api_key = None
        youtube_tools.set_api_key()
        content_fixture = youtube_tools.go_pafy(TRACK_SEARCH, metadata_fixture)
        title = youtube_tools.get_youtube_title(content_fixture, 1)
        assert title == "1. {0}".format(EXPECTED_TITLE)
github ritiek / spotify-downloader / spotdl / downloader.py View on Github external
def __init__(self, raw_song, number=None):
        self.raw_song = raw_song
        self.number = number
        self.content, self.meta_tags = youtube_tools.match_video_and_metadata(raw_song)
        self.total_songs = int(self.meta_tags["total_tracks"])