feat: gate download options on real-time yt-dlp video analysis
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>
This commit is contained in:
+12
-2
@@ -9,13 +9,23 @@
|
||||
"urlLabel": "URL de la vidéo",
|
||||
"format": "Format",
|
||||
"quality": "Qualité",
|
||||
"subtitles": "Sous-titres (fr, en)",
|
||||
"subtitles": "Sous-titres",
|
||||
"subtitleLanguages": "Langues des sous-titres",
|
||||
"advanced": "Options avancées",
|
||||
"formats": "mp4 · mp3 · webm · mkv",
|
||||
"submit": "Télécharger",
|
||||
"submitting": "Envoi en cours...",
|
||||
"errorRateLimit": "Trop de soumissions. Réessayez dans une heure.",
|
||||
"errorGeneric": "Erreur lors de la soumission."
|
||||
"errorGeneric": "Erreur lors de la soumission.",
|
||||
"analyzing": "Analyse de la vidéo...",
|
||||
"probeError": "Impossible d'analyser cette vidéo. Vérifiez le lien ou réessayez.",
|
||||
"retry": "Réessayer",
|
||||
"audioOnlySource": "Source audio uniquement",
|
||||
"clipRange": "Extrait (optionnel)",
|
||||
"clipStart": "Début (s)",
|
||||
"clipEnd": "Fin (s)",
|
||||
"audioQuality": "Qualité audio",
|
||||
"videoLength": "Durée : {duration}"
|
||||
},
|
||||
"status": {
|
||||
"heading": "Statut du téléchargement",
|
||||
|
||||
Reference in New Issue
Block a user