Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Brunight/youtube-dl-api

Repository files navigation

🎈 About

This is a REST API for converting Youtube videos to mp3 files with metadata (tags) and album cover art using youtube-dl and ffmpeg. Please use alongside with @brunight/youtube-dl-web.

📝 Requirements

  • NodeJS and NPM or Yarn;

Linux and MacOS:

🛠 Installation

In Windows, since youtube-dl does not need Python to work, the API will try to download it and save to bin/youtube-dl.exe.

In Linux and MacOS, you'll need to manually install Python version 2.6, 2.7, or 3.2+ and youtube-dl. Follow the instructions in the links above. If you already have youtube-dl binarie installed, see Configuration to know how to set it.

With npm do:

npm install

Or with yarn do:

yarn install

⚙ Configuration

You can set the directories where files will be generated and the path for youtube-dl binarie with Environment Variables. Create a file named .env in project root and put there your configuration. For examples, check .env.example. If no temp directory is provided, it'll be created at project root.

🚀 Usage

To start with npm do:

npm run dev:server

Or with yarn do:

yarn dev:server

You really should use the React web interface recommended above with this API, directly accessing it can be troublesome at the time.

The API's main route is POST /youtube, with parameters:

  • id: Youtube video id.
  • title: Music title.
  • artist: Music artist.
  • album: Music album.
  • comment: Music comment (usually original video's link).
  • cover (optional): Url of album cover art.
  • startTime (optional): Start time. Ex: 00:00:30.000.
  • endTime (optional): End time. Ex: 00:04:30.000.
  • duration (optional): End time - start time. Ex: 00:04:00.000.

If successful, filename will be returned:

{
  "fileName": "Artist - Title.mp3"
}

You can also use POST /cover route to upload album cover art to server with parameter cover.

👨‍💻 Technologies

📜 Planned features

Check in @brunight/youtube-dl-web.

📃 License

MIT. Not recommended to use with copyrighted content. Developed by Bruno Rodrigues.

About

A NodeJS REST API that uses youtube-dl and ffmpeg to convert Youtube videos to mp3 with metadata.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors