- Required for auth setup and running
docker build -t sfy2ytm .
- Run command and follow
ytmusicapi oauth
instructions to auth with Google via browserdocker run -it --entrypoint bash sfy2ytm -c 'ytmusicapi oauth; cat oauth.json'
- Copy the JSON blob into
src/oauth.json
- Create a Spotify app
- Request Access Token
- Obtain
Client ID
andClient secret
from Developer Portal
docker run -it -v ./src:/opt/sfy2ytm \
-e SFY_CLIENT_ID='<Spotify Client ID>' \
-e SFY_CLIENT_SECRET='<Spotify Client secret>' \
-e SPOTIFY_PLAYLIST_URI='spotify:playlist:3ej1snYYTQRwtnx9LxTp1g' \
sfy2ytm
A new playlist sfy2ytm_test
will be created in the target Youtube Music account, and begin to be populated.
setting up clients
defining playlists
Loaded 902 spotify playlist items
0: SFY Artist: Ry Cooder - Track: Tattler
0: YTM Artist: Ry Cooder - Track: Tattler
1: SFY Artist: Ry Cooder - Track: Stand by Me
1: YTM Artist: Ry Cooder - Track: Stand by Me
2: SFY Artist: Nick Cave & The Bad Seeds - Track: O Children
2: YTM Artist: Nick Cave & The Bad Seeds - Track: O Children
3: SFY Artist: Cream - Track: Badge
3: YTM Artist: Cream - Track: Badge
4: SFY Artist: Max Richter - Track: On the Nature of Daylight
4: YTM Artist: Max Richter Orchestra - Track: Richter: On The Nature Of Daylight (Orchestral Version)
5: SFY Artist: La Roux - Track: Let Me Down Gently
5: YTM Artist: La Roux - Track: Let Me Down Gently
6: SFY Artist: Balthazar - Track: Blood Like Wine
6: YTM Artist: Balthazar - Track: Blood Like Wine
7: SFY Artist: Florence + The Machine - Track: King
7: YTM Artist: Florence + The Machine - Track: King
8: SFY Artist: Pink Floyd - Track: A Great Day For Freedom - 2011 Remaster
8: YTM Artist: Pink Floyd - Track: A Great Day For Freedom
Note: This only works on a single playlist
- Create a new Youtube Music playlist
- Get all tracks in playlist, then for each
- Get track details (title, artist)
- Search Youtube Music given title and artist
- Add the first hit to the new YTM playlist
- Built using Spotipy and ytmusicapi 🙏
- This was a personal project to migrate a few specific playlist, therefore it is very hacky, unsupported, subject to occassional rate limiting, use at own risk etc etc