Compare commits

..

No commits in common. "62f1b5965ea1ad0663ef83de00019c3752fafbdf" and "a30266938426308a6fae4c1a32e926f78141d028" have entirely different histories.

3 changed files with 8 additions and 40 deletions

View File

@ -1,18 +1,15 @@
# yt-dlf — Handoff
> Übergabedokument für die Fortsetzung in einer Claude-Code-Session.
> Stand: 2026-08-30 — App läuft produktiv auf Gisela unter
> Stand: 2026-08-29 — App läuft produktiv auf Gisela unter
> http://172.30.1.11:3300 (nur internes Netz), Downloads nach
> `/home/stwaidele/YouTube/<Titel>/`. Zuletzt: Fortschrittsanzeige
> gefixt (eine sich aktualisierende Zeile statt Zeilen-Kaskade),
> serverseitig live verifiziert.
> `/home/stwaidele/YouTube/<Titel>/`. Neu: Whisper-Transkriptions-Fallback
> für Videos ohne Untertitel, live verifiziert (archive.org en + Instagram
> de, RTX 3080).
> Dauerhafte Fakten stehen in `README.md`/`INSTALL.md`; hier steht nur, was
> **nicht** aus Code und Git-Historie ersichtlich ist.
**🔜 NÄCHSTE SESSION:** Kein konkreter inhaltlicher Auftrag hinterlegt.
Beim nächsten echten Download beiläufig prüfen, ob die Fortschrittszeile
im Browser wirklich in-place aktualisiert (Client-Teil des Fixes vom
30.08. ist implementiert, aber noch nicht im Browser beobachtet).
Arbeitskopie auf Gisela: `/home/stwaidele/Claude/yt-dlf` (am 29.08. von
`yt-dlp` umbenannt; systemd-Unit-Pfade angepasst, venv läuft weiter —
pip darin nur noch als `.venv/bin/python -m pip` aufrufen, der
@ -51,25 +48,6 @@ pip darin nur noch als `.venv/bin/python -m pip` aufrufen, der
führende Wiederholungszeilen (`src/lib/subtitle.js`,
`scripts/subtitle_to_markdown.py`, beide identisch halten!).
## Session 2026-08-30 — Fortschrittsanzeige gefixt (Claude Fable 5)
Stefans Befund (mit Screenshots vom iPhone): jede yt-dlp-Progress-Zeile
erzeugte ein neues Log-Element — hunderte fast identische Kästen.
Ursache: yt-dlp überschreibt seine Fortschrittszeile per `\r` in-place,
die App schickte aber jedes Update als eigenes `log`-Event. Fix:
Server taggt Fortschrittszeilen als Event-Typ `progress`
(`/^\[download\]\s+[~\d]/` — bewusst breiter als nur `%`, weil
Downloads unbekannter Größe prozentlose Zeilen wie
`[download] 440.00B at Unknown B/s` ausgeben; ffmpeg-Zeilen
`frame=`/`size=` ebenso), Client ersetzt bei `progress` die vorige
Zeile, wenn diese auch `progress` war. Serverseitig live verifiziert
(SSE-Stream per curl, „Me at the zoo"); Client-Ersetzung implementiert,
im Browser noch nicht beobachtet. Nebeneffekt des Tests: die am 29.08.
versehentlich mit Whisper überschriebene
`~/YouTube/Me at the zoo/Me at the zoo.en.vtt` ist wieder die echte
YouTube-Caption. Stefans Debug-Screenshots (`IMG_70*.PNG` im
Projekt-Root) bleiben bewusst untracked.
## Session 2026-08-29 — Verzeichnis-Umbenennung & Memory-Umzug (Claude Fable 5)
Lokales Verzeichnis auf Gisela von `yt-dlp` nach `yt-dlf` umbenannt

View File

@ -24,15 +24,7 @@
es.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type !== 'zip-ready') {
// Progress updates replace the previous progress line instead of
// piling up as new entries (yt-dlp rewrites that line in place)
if (data.type === 'progress' && log.at(-1)?.type === 'progress') {
log = [...log.slice(0, -1), data];
} else {
log = [...log, data];
}
}
if (data.type !== 'zip-ready') log = [...log, data];
setTimeout(scrollToBottom, 0);
if (data.type === 'zip-ready') {

View File

@ -88,9 +88,7 @@ async function runDownload(videoUrl, audioOnly, send, signal) {
'--no-playlist',
videoUrl
], line => {
// yt-dlp rewrites its progress line in place (carriage return); tag those
// updates so the client can replace the previous one instead of appending
send(/^\[download\]\s+[~\d]/.test(line) ? 'progress' : 'log', line);
send('log', line);
const sub = line.match(/\[info\] Writing video subtitles to: (.+)/);
if (sub) subtitlePaths.push(sub[1].trim());
const merge = line.match(/\[Merger\] Merging formats into "(.+)"/);
@ -154,7 +152,7 @@ async function runDownload(videoUrl, audioOnly, send, signal) {
send('info', `Extracting audio: ${basename(audioPath)}`);
await runProcess(FFMPEG, [
'-i', videoPath, '-vn', '-acodec', 'libmp3lame', '-q:a', '2', '-y', audioPath
], line => send(/^(?:frame|size)=/.test(line) ? 'progress' : 'log', line), signal);
], line => send('log', line), signal);
send('info', `Audio saved: ${basename(audioPath)}`);
}
@ -184,7 +182,7 @@ function runProcess(cmd, args, onLine, signal, spawnOptions = {}) {
const settle = (fn, val) => { if (!settled) { settled = true; fn(val); } };
const handleData = data =>
data.toString().split(/\r\n|\n|\r/).filter(Boolean).forEach(onLine);
data.toString().split('\n').filter(Boolean).forEach(onLine);
proc.stdout.on('data', handleData);
proc.stderr.on('data', handleData);