Skip to content

A simple download manager for downloading songs using youtube-dl

License

Notifications You must be signed in to change notification settings

GT3CH1/YouTubeMusicDownloader-Api

Repository files navigation

YouTubeMusicDownloader-Api

A simple API for downloading music/audio from YouTube using NYouTubeDL. This was originally developed as a way to download music for transfer to my plex server. The songs are downloaded to a folder called "Songs", and are organized by artist and album , Songs/Test Artist/Test Album/Song.mp4. Each song will have be tagged with the artist, album, and song title as well. As of now, it is up to the user to properly use the program and populate all fields on the main webpage.

Prepwork

  1. Install youtube-dl
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/bin/youtube-dl
sudo chmod a+rx /usr/bin/youtube-dl
  1. Ensure ASP.NET Core and dotnet 6.x is installed
  2. Clone the repository
git clone https://github.com/GT3CH1/YouTubeMusicDownloader-Api
  1. Build the project
cd YouTubeMusicDownloader-Api
dotnet build
  1. Run the project
dotnet ./YouTubeDownloader/bin/Debug/net6.0/YouTubeDownloader.dll
  1. Done!

How to Use/Endpoints

Opening the main webpage.

Navigate to the URL that is shown in your terminal when you start the application.

Adding a song through the webpage.

At the top of the webpage, there is four fields you will have to input.

  1. The title of the song
  2. The artist of the song
  3. The album of the song
  4. The YouTube URL of the song

Once you have filled out the fields, click the "Add Song" button. The song is stored in a database, and is ready to be downloaded. Please see the "Downloading a Song" section for more information.

Store a URL to download

POST /api/Song/Add 
{
    "Url": "https://www.youtube.com/watch?v=some-url",
    "Title": "Test Video",
    "Artist": "Test Artist",
    "Album": "Test Album"
}

Store a list

POST /api/Song/AddList
[
    {
        "Url": "https://www.youtube.com/watch?v=some-url",
        "Title": "Test Video",
        "Artist": "Test Artist",
        "Album": "Test Album"
    },
    {
        "Url": "https://www.youtube.com/watch?v=some-url",
        "Title": "Test Video",
        "Artist": "Test Artist",
        "Album": "Test Album"
    }
]

Get a list of songs

GET /api/Song/GetList

Get a song

GET /api/Song/Get/{id}

Delete a song

DELETE /api/Song/Delete/{id}

Delete all songs

DELETE /api/Song/DeleteAll

Edit a song

PUT /api/Song/Edit/{id}
{
    "Url": "https://www.youtube.com/watch?v=some-url",
    "Title": "Test Video",
    "Artist": "Test Artist",
    "Album": "Test Album",
}

Download a song

GET /api/Song/Download/{id}

Download all songs

GET /api/Song/DownloadAll

Things to do

  • Add a way to get a list of songs
  • Add a way to remove a song/list of songs
  • Add a way to download ONE song.
  • Add a way to download all of the songs.
  • Add a way to set the artist/album/title of a song.
  • Add a way to edit songs

If you run into any bugs, or would like to request/add a feature, please open an issue on the GitHub repository. Any and all help is appreciated.