{"openapi":"3.1.0","info":{"title":"yt-dlp Web UI API","description":"Video downloading service using yt-dlp with queue management, format selection, and download tracking","version":"1.0.0","contact":{"name":"yt-dlp-web-ui","url":"https://github.com/marcopiovanello/yt-dlp-web-ui"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://downloader.haiven.site","description":"Production via Traefik"},{"url":"http://video-downloader:3033","description":"Internal Docker network access"}],"tags":[{"name":"Downloads","description":"Download management operations"},{"name":"Queue","description":"Queue status and management"},{"name":"System","description":"System information"}],"paths":{"/":{"get":{"summary":"Web UI","description":"Serves the yt-dlp-web-ui frontend application","tags":["System"],"operationId":"getWebUI","responses":{"200":{"description":"HTML page returned","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/v1/exec":{"post":{"summary":"Submit download","description":"Queue a new video or audio download with optional yt-dlp arguments","tags":["Downloads"],"operationId":"submitDownload","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","path"],"properties":{"url":{"type":"string","description":"URL to download (YouTube, Vimeo, Twitter, etc.)","example":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"},"path":{"type":"string","description":"Output directory path inside container","example":"/downloads"},"rename":{"type":"string","description":"Custom filename (without extension)","example":""},"args":{"type":"string","description":"Additional yt-dlp arguments","example":"-f bestvideo+bestaudio --embed-thumbnail"}}},"examples":{"video":{"summary":"Download video","value":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","path":"/downloads","rename":"","args":""}},"audio":{"summary":"Extract audio as MP3","value":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","path":"/audio","rename":"","args":"-x --audio-format mp3 --audio-quality 0"}},"subtitles":{"summary":"Download with subtitles","value":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","path":"/downloads","rename":"","args":"--write-subs --embed-subs --sub-lang en"}}}}}},"responses":{"200":{"description":"Download queued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadResponse"}}}},"400":{"description":"Invalid request parameters"},"500":{"description":"Internal server error"}}}},"/api/v1/running":{"get":{"summary":"Get running downloads","description":"List all currently active downloads with progress information","tags":["Downloads"],"operationId":"getRunningDownloads","responses":{"200":{"description":"List of active downloads","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Download"}},"example":[{"id":"0af9be94-a3f1-47ae-856d-93b7c2af516f","progress":{"process_status":1,"percentage":"45.2","speed":5242880,"eta":120},"info":{"url":"https://www.youtube.com/watch?v=example","title":"Example Video Title","thumbnail":"https://i.ytimg.com/vi/example/maxresdefault.jpg","resolution":"1920x1080","filesize_approx":104857600,"vcodec":"avc1.640028","acodec":"opus","ext":"mkv"}}]}}}}}},"/api/v1/completed":{"get":{"summary":"Get completed downloads","description":"List all completed downloads","tags":["Downloads"],"operationId":"getCompletedDownloads","responses":{"200":{"description":"List of completed downloads","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Download"}}}}}}}},"/api/v1/queue":{"get":{"summary":"Get queue status","description":"Get current download queue information","tags":["Queue"],"operationId":"getQueueStatus","responses":{"200":{"description":"Queue status","content":{"application/json":{"schema":{"type":"object","properties":{"length":{"type":"integer","description":"Number of items in queue"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Download"}}}}}}}}}},"/api/v1/abort/{id}":{"post":{"summary":"Abort download","description":"Cancel a running or queued download by ID","tags":["Downloads"],"operationId":"abortDownload","parameters":[{"name":"id","in":"path","required":true,"description":"Download ID to abort","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Download aborted successfully"},"404":{"description":"Download not found"}}}},"/api/v1/clear":{"post":{"summary":"Clear completed downloads","description":"Remove all completed downloads from history","tags":["Downloads"],"operationId":"clearCompleted","responses":{"200":{"description":"Completed downloads cleared"}}}}},"components":{"schemas":{"Download":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique download identifier"},"progress":{"$ref":"#/components/schemas/Progress"},"info":{"$ref":"#/components/schemas/VideoInfo"},"output":{"$ref":"#/components/schemas/OutputInfo"},"params":{"type":"array","items":{"type":"string"},"description":"yt-dlp parameters used"}}},"Progress":{"type":"object","properties":{"process_status":{"type":"integer","description":"Status code (0=pending, 1=downloading, 2=completed, 3=error)","enum":[0,1,2,3]},"percentage":{"type":"string","description":"Download progress percentage"},"speed":{"type":"number","description":"Download speed in bytes/second"},"eta":{"type":"number","description":"Estimated time remaining in seconds"}}},"VideoInfo":{"type":"object","properties":{"url":{"type":"string","description":"Original URL"},"title":{"type":"string","description":"Video title"},"thumbnail":{"type":"string","description":"Thumbnail URL"},"resolution":{"type":"string","description":"Video resolution (e.g., 1920x1080)"},"filesize_approx":{"type":"integer","description":"Approximate file size in bytes"},"vcodec":{"type":"string","description":"Video codec"},"acodec":{"type":"string","description":"Audio codec"},"ext":{"type":"string","description":"Output file extension"},"original_url":{"type":"string","description":"Original URL before any redirects"},"filename":{"type":"string","description":"Output filename"},"created_at":{"type":"string","format":"date-time","description":"Download creation timestamp"}}},"OutputInfo":{"type":"object","properties":{"Path":{"type":"string","description":"Output directory"},"Filename":{"type":"string","description":"Output filename"},"savedFilePath":{"type":"string","description":"Full path to saved file"}}},"DownloadResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Assigned download ID"},"status":{"type":"string","description":"Queue status"}}}}}}