Skip to main content

songsync

PyPI version

Convert YouTube and YouTube Music playlists to Spotify playlists

Installation

pip install songsync

Setup

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

To convert a playlist from YouTube to Spotify, provide the playlist ID of the YouTube playlist and the name of the playlist you want to create in Spotify.

from songsync.songsync import SongSync

ss = SongSync()
spotify_playlist_id, tracks_not_found = ss.convert_yt_spotify(
    yt_playlist_id="PLkZa6xWYS81W6wdF6HSpuqOuVCgu9mzjD",
    spotify_playlist_name="Your Spotify Playlist Name",
)

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.
  • (Experimental) 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.

Interactive Mode

ss = SongSync(interactive_mode=True)

With 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.

Local Development

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

Follow the above instructions for setting up your Spotify app and environment variables.

Metadata

Release files for songsync 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for songsync 0.1.4
File Size Uploaded
songsync-0.1.4.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for songsync 0.1.4
File Interpreter ABI Platform
songsync-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / songsync-0.1.4.tar.gz

Download URL songsync-0.1.4.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1521dc1b7fe9ee7cfbc20ac41b548eb4590126b5ed940d03e7851fb384397341
BLAKE2b-256 checksum
How to use checksums
ea47803fe65c5c77dceca130ecac49509cc0acd9d54632061f14540b2d71e677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Darwin/22.5.0

Release files / songsync-0.1.4-py3-none-any.whl

Download URL songsync-0.1.4-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ae06cbbf552d8656757a32fbe9dc7d5c163bedd3bdb19b4bcfe96450fb572d2
BLAKE2b-256 checksum
How to use checksums
28105139ffb23a2f9fe4b801dd6910170bfcbff57f5b217cef3646d2961eb340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Darwin/22.5.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page