Giter Site home page Giter Site logo

music-playlist-converter's Introduction

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}"}

music-playlist-converter's People

Contributors

to-dy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.