Skip to content

Convert music playlists between Spotify, YouTube Music & Apple Music.

License

Notifications You must be signed in to change notification settings

to-dy/music-playlist-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music playlist converter, supports Spotify, YouTubeMusic & Apple Music

Overview


Built primarily to learn Go and solve a personal need. This app converts music playlists between platforms. It currently supports conversions between Spotify & YouTube Music. Conversion from Apple Music coming soon

Setup


cd your-repo
go mod tidy

Set up the required environment variables in internal/env/.env


Start the API server:

go run cmd/app/main.go

Flow


verify playlist url -> authorize -> convert


Endpoints


  • GET /api/auth/spotify

 Description: Initiates the authentication flow with Spotify.
 Status: 307
 Response: Temporary redirect to the Spotify authorization page.
  • GET /api/auth/spotify_callback

Description: Callback endpoint for Spotify authentication.
Status: 302
Response: Redirect to the UI
  • GET /api/auth/youtube

Description: Initiates the authentication flow with YouTube.
Status: 307
Response: Temporary redirect to the YouTube authorization page.
  • GET /api/auth/youtube_callback

Description: Callback endpoint for YouTube authentication.
Status: 302
Response: Redirect to the UI
  • GET /api/playlist/verify

Description: Verify if a playlist URL is valid.
Method: GET
Query Parameter: url - The URL of the playlist to verify.
Response: JSON data with verification result.

Example Response

{
  "isPlaylistValid": true,
  "supportedConversions": ["spotify", "apple-music"],
  "playlistData": {
    "url": "string",
    "thumbnailUrl": "string",
    "tracks": [],
    "playlistName": "string",
    "playlistTracksCount": 5,
    "source": "string"
  }
}
  • GET /api/playlist/convert/preview

Description: Preview the playlist to be converted.
Session Required: Yes
Response: JSON data containing the preview of the converted playlist.
  • POST /api/playlist/convert/start

Description: Start the playlist conversion process.
Session Required: Yes
Request Body : {"title" : "string"}
Status: 201 Created
Response Body: JSON data containing the new URL of the converted playlist or an error message.
  • GET /api/playlist/convert/start/stream

Description: Start the playlist conversion process and stream process.
Session Required: Yes
Query Parameter: title - The title of the converted playlist.
Response Content-Type: text/stream

Example Response

event: info
data:  "string"

event: error
data:  "string"

event: track_search
data:  "{"message": "string","track": "{trackObj}","status": "string","success":bool}"

event: done
data: {"message": "string", "info": "{"tracks_found": 0, "tracks_not_found": 0, "conversion_successful": bool}"}

About

Convert music playlists between Spotify, YouTube Music & Apple Music.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages