Options (quality, subtitles) are now derived from a yt-dlp -J probe of the submitted URL instead of a static list, so users can't pick combinations the source video doesn't actually support. Submission is blocked until the probe succeeds. - New /api/probe endpoint + src/lib/ytdlp-probe.ts, with its own rate limiter (rate-limit.ts refactored into a createRateLimiter factory). - New options: subtitle language selection, clip start/end trim, MP3 audio quality. - Fixed buildYtdlpArgs: format=mp3 never triggered audio extraction (-x/--audio-format), and quality=best never applied --merge-output-format, so the chosen container had no real effect. - Cross-platform yt-dlp invocation: the bundled bin/yt-dlp is a Python zipapp relying on a shebang, which Windows' spawn() can't run directly. buildYtdlpCommand() runs it through `python` on Windows and execs it directly on Linux/o2switch, where the shebang works natively. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
}
|
|
|
|
model Download {
|
|
id String @id @default(cuid())
|
|
uuid String @unique @default(uuid())
|
|
url String @db.Text
|
|
status Status @default(PENDING)
|
|
format String
|
|
quality String
|
|
subtitles Boolean @default(false)
|
|
subtitleLangs String? @db.Text
|
|
clipStart Int?
|
|
clipEnd Int?
|
|
audioQuality String?
|
|
extraArgs String? @db.Text
|
|
|
|
filePath String? @db.Text
|
|
fileName String?
|
|
fileSize BigInt?
|
|
errorMsg String? @db.Text
|
|
|
|
ipAddress String
|
|
submittedAt DateTime @default(now())
|
|
startedAt DateTime?
|
|
completedAt DateTime?
|
|
deletedAt DateTime?
|
|
|
|
tokens DownloadToken[]
|
|
}
|
|
|
|
model DownloadToken {
|
|
id String @id @default(cuid())
|
|
download Download @relation(fields: [downloadId], references: [id])
|
|
downloadId String
|
|
token String @unique @default(uuid())
|
|
expiresAt DateTime
|
|
usedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
enum Status {
|
|
PENDING
|
|
PROCESSING
|
|
DONE
|
|
FAILED
|
|
FILE_DELETED
|
|
}
|