7.4 KiB
7.4 KiB
API Endpoints
All API routes are mounted under /api unless noted otherwise.
Video Download & Search
GET /api/search- Search videos online (YouTube)- Query params:
query(required),limit(optional, default: 8),offset(optional, default: 1)
- Query params:
POST /api/download- Download a video from supported platforms- Body:
{ youtubeUrl: string, ...options } - Supports: YouTube, Bilibili, MissAV, and all yt-dlp supported sites
- Body:
GET /api/check-video-download- Check if a video has already been downloaded- Query params:
url(required) - Returns:
{ found: boolean, status: 'exists' | 'deleted', videoId?: string, ... }
- Query params:
GET /api/check-bilibili-parts- Check if a Bilibili video has multiple parts- Query params:
url(required)
- Query params:
GET /api/check-bilibili-collection- Check if a Bilibili URL is a collection/series- Query params:
url(required)
- Query params:
GET /api/check-playlist- Check if a URL is a supported playlist- Query params:
url(required)
- Query params:
GET /api/download-status- Get active/queued download status- Returns:
{ activeDownloads: DownloadInfo[], queuedDownloads: DownloadInfo[] }
- Returns:
Video Management
POST /api/upload- Upload a local video file- Multipart form data:
video(file) - Automatically generates thumbnail
- Multipart form data:
GET /api/videos- Get all downloaded videos- Query params:
page(optional),limit(optional),sortBy(optional),order(optional),search(optional),author(optional),tags(optional)
- Query params:
GET /api/videos/:id- Get a specific video by IDPUT /api/videos/:id- Update video details- Body:
{ title?, author?, tags?, rating?, ... }
- Body:
DELETE /api/videos/:id- Delete a video and its filesGET /api/videos/:id/comments- Get video comments (if available)POST /api/videos/:id/rate- Rate a video (1-5 stars)- Body:
{ rating: number }
- Body:
POST /api/videos/:id/refresh-thumbnail- Refresh video thumbnailPOST /api/videos/:id/view- Increment view countPUT /api/videos/:id/progress- Update playback progress- Body:
{ progress: number }(seconds)
- Body:
GET /api/videos/author-channel-url- Get author channel URL for a video- Query params:
sourceUrl(required) - Returns:
{ success: boolean, channelUrl: string | null }
- Query params:
Download Management
POST /api/downloads/cancel/:id- Cancel an active downloadDELETE /api/downloads/queue/:id- Remove a download from queueDELETE /api/downloads/queue- Clear entire download queueGET /api/downloads/history- Get download history- Query params:
page(optional),limit(optional)
- Query params:
DELETE /api/downloads/history/:id- Remove an item from download historyDELETE /api/downloads/history- Clear entire download history
Collections
GET /api/collections- Get all collectionsPOST /api/collections- Create a new collection- Body:
{ name: string, videoIds?: string[] }
- Body:
PUT /api/collections/:id- Update a collection (add/remove videos)- Body:
{ name?: string, videoIds?: string[], action?: 'add' | 'remove' }
- Body:
DELETE /api/collections/:id- Delete a collection
Subscriptions
GET /api/subscriptions- Get all subscriptionsPOST /api/subscriptions- Create a new subscription- Body:
{ authorUrl: string, interval: number, platform?: string } interval: Check interval in minutesplatform: 'YouTube' (default) or 'Bilibili'
- Body:
DELETE /api/subscriptions/:id- Delete a subscription
Continuous Download Tasks (Subscriptions)
GET /api/subscriptions/tasks- Get all continuous download tasks- Query params:
page(optional),limit(optional)
- Query params:
POST /api/subscriptions/tasks/playlist- Create a new playlist download task- Body:
{ url: string, ...options }
- Body:
DELETE /api/subscriptions/tasks/:id- Cancel a continuous download taskDELETE /api/subscriptions/tasks/:id/delete- Delete a task recordDELETE /api/subscriptions/tasks/clear-finished- Clear all finished tasks
Settings & Passwords
GET /api/settings- Get application settingsPOST /api/settings- Update application settings- Body:
{ [key: string]: any }- Settings object
- Body:
GET /api/settings/cloudflared/status- Get Cloudflare Tunnel statusPOST /api/settings/migrate- Migrate data from JSON to SQLitePOST /api/settings/delete-legacy- Delete legacy JSON data filesPOST /api/settings/format-filenames- Format video filenames according to settingsGET /api/settings/password-enabled- Check if password protection is enabledGET /api/settings/reset-password-cooldown- Get cooldown time for password resetPOST /api/settings/verify-admin-password- Verify admin password- Body:
{ password: string }
- Body:
POST /api/settings/verify-visitor-password- Verify visitor password- Body:
{ password: string }
- Body:
POST /api/settings/verify-password- Verify login password (deprecated)- Body:
{ password: string }
- Body:
POST /api/settings/reset-password- Reset login password- Body:
{ oldPassword: string, newPassword: string }
- Body:
POST /api/settings/logout- Logout current session
Passkey Management
GET /api/settings/passkeys- Get all registered passkeysGET /api/settings/passkeys/exists- Check if any passkeys are registeredPOST /api/settings/passkeys/register- Start passkey registrationPOST /api/settings/passkeys/register/verify- Verify passkey registrationPOST /api/settings/passkeys/authenticate- Start passkey authenticationPOST /api/settings/passkeys/authenticate/verify- Verify passkey authenticationDELETE /api/settings/passkeys- Remove all passkeys
Cookies
POST /api/settings/upload-cookies- Upload cookies.txt for yt-dlp- Multipart form data:
file(cookies.txt)
- Multipart form data:
POST /api/settings/delete-cookies- Delete cookies.txtGET /api/settings/check-cookies- Check if cookies.txt exists
Task Hooks
GET /api/settings/hooks/status- Get status of all hooksPOST /api/settings/hooks/:name- Upload a hook script- Multipart form data:
file(script file) - Params:
name(hook name, e.g.,task_success)
- Multipart form data:
DELETE /api/settings/hooks/:name- Delete a hook script
Database Backups
GET /api/settings/export-database- Export database as backup filePOST /api/settings/import-database- Import database from backup file- Multipart form data:
file(database backup file)
- Multipart form data:
GET /api/settings/last-backup-info- Get information about the last database backupPOST /api/settings/restore-from-last-backup- Restore database from the last backupPOST /api/settings/cleanup-backup-databases- Clean up old backup database files
File Management
POST /api/scan-files- Scan for existing video files in uploads directoryPOST /api/cleanup-temp-files- Cleanup temporary download files
Cloud Storage
GET /api/cloud/signed-url- Get a signed URL for cloud storage- Query params:
filename(required),type(optional:videoorthumbnail)
- Query params:
POST /api/cloud/sync- Sync local videos to cloud storage (streams JSON lines)DELETE /api/cloud/thumbnail-cache- Clear local thumbnail cacheGET /api/cloud/thumbnail-cache/:filename- Serve a cached cloud thumbnailGET /cloud/videos/:filename- Redirect to signed URL for cloud videosGET /cloud/images/:filename- Redirect to signed URL (or cached file) for cloud thumbnails
System
GET /api/system/version- Get current and latest version info- Returns:
{ currentVersion, latestVersion, releaseUrl, hasUpdate }
- Returns: