Skip to main content

Convert YouTube playlists to Spotify playlists

Project description

songsync

Convert YouTube and YouTube Music playlists to Spotify playlists

Setup

Install poetry: https://python-poetry.org/docs/#installation

Setup and activate virtual environment

python3 -m venv .venv && source .venv/bin/activate

Install poetry dependencies

poetry install

Create a Spotify app by following the instructions in the Spotify Web API documentation: https://developer.spotify.com/documentation/web-api

Set the following environment variables

export SPOTIPY_CLIENT_ID='your-spotify-client-id'
export SPOTIPY_CLIENT_SECRET='your-spotify-client-secret'
export SPOTIPY_REDIRECT_URI='your-app-redirect-url'

Usage

Run the command line script and set yt_playlist_id and spotify_playlist_name to your YouTube playlist ID and what you'd like to name the Spotify playlist.

Notes:

  • The YT playlist ID can be found from the URL of your Youtube/Youtube Music playlist.
  • The YT playlist must be public or unlisted.
  • The search algorithm uses language detection to search different Spotify markets and substrings of a song title.
    • Titles are more varied for normal YouTube videos in comparison to YouTube Music videos which can increase the difficulty of the search. The closer the YouTube video name is to the Spotify name the easier it is to find. See interactive mode below for manually searching tracks that cannot be found.

Example:

./songsync_cmd.sh --yt_playlist_id PLwjEXrvFo-2Bs1-hvfjQ_G61COZ0aBTK5 --spotify_playlist_name "My Playlist"

For interactive mode, include the --interactive flag.

Example:

./songsync_cmd.sh --yt_playlist_id PLwjEXrvFo-2Bs1-hvfjQ_G61COZ0aBTK5 --spotify_playlist_name "My Playlist" --interactive

In interactive mode, if the script cannot find the YouTube track on Spotify you will be prompted to manually enter a title and artist. Enter it as it would appear in your country. You can enter blank in the prompt to skip.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

songsync-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

songsync-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file songsync-0.1.0.tar.gz.

File metadata

  • Download URL: songsync-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/22.5.0

File hashes

Hashes for songsync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd49664f211ad710f6ff93c1599c6bbdd6a394b8a816a742dc12fe9f52239aae
MD5 c6a8a1d95ab2208026ab483a0623252e
BLAKE2b-256 50a3ff1a6a26679b36bf27324c760eff74b5314c7f5115af8dd213b8ee63890f

See more details on using hashes here.

File details

Details for the file songsync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: songsync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/22.5.0

File hashes

Hashes for songsync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2537c38da02910466b1099acd3ab2c1c48b881d8abcf83a4e65c45f156ed5251
MD5 0e0b412f33899eecadf2b33296018313
BLAKE2b-256 f83dfeeaf05ac2be8a71cee70cf0ef516dc54b31903db9c8644611857e34667f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page