DougaAPI is a specialized API designed exclusively for the DougaBot.
Before running this project make sure you have ffmpeg and yt-dlp.
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"
  }
}- YtdlpPathand- FfmpegPathare the paths to the executables, in this example we assume they are in the- PATHenvironment 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.
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>"
}'download
compress
trim
toaudio
The API will return an error code in the headers along with a JSON structure containing the error message:
{
  "error": "string"
}