DougaAPI
DougaAPI is a specialized API designed exclusively for the DougaBot.
Before running this project make sure you have ffmpeg and yt-dlp.
appsettings.json
AppSettings have default values set by
AppSettings.cs, to override these values, you can
create appsettings.json
Here is an example:
{
"Settings": {
"YtdlpPath": "yt-dlp",
"FfmpegPath": "ffmpeg",
"MaxDuration": "02:00:00",
"MaxTrimTime": "00:15:00",
"MaxCompressTime": "00:05:00"
}
}Notes
YtdlpPathandFfmpegPathare the paths to the executables, in this example
we assume they are in thePATHenvironment variable.MaxDuration, is the maximum duration of a video no matter the operation
(download, compress, trim).MaxTrimTimeis the maximum duration of a video when trimming.MaxCompressTimeis the maximum duration of a video when compressing.- So in your example case a video can be at most 2 hours long, the trimming time
is 15 minutes and the compressing time is 5 minutes.
JSON Structure
Each JSON structure inherits from QueryBase thus each end point needs to have
the following properties as a base:
For example if you want to just download a video you will need to make the
following requests:
curl --location 'https://<dougaapi-url>/compress' \
--header 'Content-Type: application/json' \
--data '{
"uri": "<video-link>"
}'Endpoints
download
compress
trim
toaudio
Errors
The API will return an error code in the headers along with a JSON structure
containing the error message:
{
"error": "string"
}On this page
Languages
C#91.7%Nix5.5%Shell1.5%Dockerfile1.3%
Contributors
Created April 13, 2023
Updated June 17, 2025