This API endpoint was modified by Bondhu Digital.
Downloads YouTube videos using `yt-dlp`, then optionally cuts segments using `ffmpeg`. Input via JSON.
Disclaimer: Downloading YouTube videos may violate their Terms of Service. Use responsibly.
Logging: Check .log files in youtube_downloads/ on errors.
/home/bondhudi/virtualenv/Bondhu_API/3.11/bin/yt-dlp/home/bondhudi/virtualenv/Bondhu_API/3.11/bin/ffmpeghttps://api.bondhudigital.com/index.php
POST
Content-Type: application/json
Send a JSON object with the following structure:
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"name": "custom_video_name",
"start_time": 30,
"end_time": 120
}
url (Required): String (Full YouTube video URL).name (Optional): String. Custom base name for the output file (sanitized). Defaults to Video ID.start_time (Optional): Number or String. Time in seconds to start the segment.end_time (Optional): Number or String. Time in seconds to end the segment.Note on Timestamps: If timestamps are provided, the full video is downloaded first, then cut using FFmpeg (`-c copy` for speed). Accuracy depends on video keyframes.
Returns a link to the downloaded file and its filename.
{
"url": "https://api.bondhudigital.com/youtube_downloads/output_filename.mp4",
"filename": "output_filename.mp4"
}
{
"error": "Error message from yt-dlp, ffmpeg, or script."
}
Check the corresponding .log file in youtube_downloads/ for details.
Copy the command, replace values inside the JSON (`-d` argument), and run.
curl -X POST 'https://api.bondhudigital.com/index.php' \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","name":"custom_video_name","start_time":30,"end_time":120}'
https://api.bondhudigital.com/index.php, Body: JSON).={{ { "url": $json.youtubeUrl, "name": $json.customName, "start_time": $json.startTimeInSeconds, "end_time": $json.endTimeInSeconds } }}