This server provides endpoints for optimizing and downloading video files. It supports partial downloads and file integrity checks.
All endpoints require Jellyfin authentication token in the Authorization header.
All endpoints may return the following error responses:
400 Bad Request: Invalid input parameters401 Unauthorized: Missing or invalid authentication404 Not Found: Resource not found500 Internal Server Error: Server error
- Partial downloads are supported using the
Rangeheader - File integrity is verified using SHA-256 checksums
- Jobs are automatically cleaned up after completion
- Concurrent job processing is limited by configuration
- Endpoint:
POST /optimize-version - Description: Queues a video for optimization
- Request Body:
{ "url": "string", // URL of the video to optimize "fileExtension": "string", // Desired output format "deviceId": "string", // Client device ID "itemId": "string", // Media item ID "item": "object" // Media item metadata } - Response:
{ "id": "string" // Job ID for tracking }
- Endpoint:
GET /download/:id - Description: Downloads the optimized video file
- Headers:
Range: Optional. Format:bytes=start-orbytes=start-endfor partial downloads
- Response: Video file stream
- Response Headers:
X-File-Checksum: String //SHA-256 checksum of the fileX-File-Size: Number //Total size of the file in bytesContent-Range: String //For partial downloads, format:bytes start-end/totalContent-Length: Number //Size of the current responseContent-Type: String //video/mp4Accept-Ranges: String //bytes
- Endpoint:
GET /job-status/:id - Description: Returns Job object
- Response:
{ "id": "string", "status": "string", // One of: queued, optimizing, pending downloads limit, completed, failed, cancelled, ready-for-removal "progress": number, // Progress percentage "outputPath": "string", "inputUrl": "string", "deviceId": "string", "itemId": "string", "timestamp": "string", // ISO date string "size": number, "item": object, "speed": number // Optional: Processing speed "checksum": string // Optional: Once the job is done, provides a checksum }
- Endpoint:
DELETE /cancel-job/:id - Description: Cancels a optimization job
- Response:
{ "message": "string" // Success or error message }
- Endpoint:
POST /start-job/:id - Description: Manually starts a queued optimization job
- Response:
{ "message": "string" // Success or error message }
- Endpoint:
GET /all-jobs - Description: Get information about all jobs
- Response: Array of job objects (like get job-status but for all jobs)
- Endpoint:
GET /statistics - Description: Get server statistics
- Response:
{ "cacheSize": "string", // Total size of cached files "totalTranscodes": number, // Total number of transcoded files "activeJobs": number, // Number of currently active jobs "completedJobs": number, // Number of successfully completed jobs "uniqueDevices": number // Number of unique devices that have used the service }
- Endpoint:
DELETE /delete-cache - Description: Cleans up all cached files
- Response: Success message