https://github.com/larry-oj/youtube-to-mp3
ASP.NET 6 WebAPI that turns youtube links to mp3.
https://github.com/larry-oj/youtube-to-mp3
asp asp-net-core aspnetcore c-sharp csharp dot-net dotnet web-api webapi
Last synced: 5 months ago
JSON representation
ASP.NET 6 WebAPI that turns youtube links to mp3.
- Host: GitHub
- URL: https://github.com/larry-oj/youtube-to-mp3
- Owner: larry-oj
- License: mit
- Created: 2022-07-03T08:00:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-01T11:47:59.000Z (almost 3 years ago)
- Last Synced: 2025-03-13T15:17:04.021Z (over 1 year ago)
- Topics: asp, asp-net-core, aspnetcore, c-sharp, csharp, dot-net, dotnet, web-api, webapi
- Language: C#
- Homepage: https://larryoj.tk/YoutubeConverter
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# YouTube to MP3 converter API
A simple, easy to use youtube-to-mp3 converter. Utilises YouTubeExplode library and ffmpeg. Additionally configured for nginx proxy.
## Table of Contents
- [Features](#features)
- [Setup](#setup)
- [Webhooking](#webhooking)
- [API Reference](#api-reference)
* [Queue video for conversion](#queue-video-for-conversion)
* [Get item status](#get-item-status)
* [Get mp3](#get-mp3)
## Features
- Creates a .mp3 file from your YouTube link
- Queueing requests to be processed in order
- Supports parallel conversion of multiple links
- Can act as a WebHook
- Automatic cleanup of finished files
## Setup
- Requires FFMpeg binaries path in `appsettings.json`.
- Requires PSQL Database connection string in `appsettings.json`
- Requires temporary directory specified in `appsettings.json` (it will store generated MP3 files)
- (Optional) Configure MP3 file local lifetime (minutes) in `appsettings.json` (default value - 10 minutes)
## Webhooking
If you provide a URL upon initial conversion request, API will send a POST request with multipart/form-data containing your mp3 to set url upon successful conversion
## API Reference
#### Queue video for conversion
```http
POST /Converter/videos
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `url` | `string` | **Required**. YouTube video url. |
| `with_callback` | `bool` | Indicates weather you want API to act as a webhook. |
| `callback_url` | `string` | **Required if `with_callback` set to `true`.** Callback url. |
Returns:
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `id` | `string` | Auto-generated ID of your request & file. |
#### Get item status
```http
GET /Converter/videos/${id}/status
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. ID of item to fetch. |
Returns:
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `id` | `string` | ID of your request & file. |
| `is_failed` | `bool` | Indicates wether conversion has failed. |
| `is_finished` | `bool` | Indicates wether conversion has been finished. |
#### Get mp3
```http
GET /Converter/videos/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. ID of item to fetch. |
Returns:
**.mp3 file**