mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 20:36:21 -05:00
YouTube auto-generated captions (via yt-dlp) stamp every cue timing line with `align:start position:0%`, pinning the on-screen text to the bottom-left of the player. This strips that exact cue setting from the downloaded .vtt files so browsers render the captions centered. - add strip_youtube_caption_positioning() to wrolpi/captions.py — a targeted text replacement (not a webvtt round-trip) so the `<c>` word-timing tags in the cue text are preserved; matches only the exact auto-caption signature, so deliberately positioned cues (e.g. with a `line` setting) are left untouched; idempotent. - call it from VideoDownloader after normalize_video_file_names, gated on a youtube.com / youtu.be source URL. It runs before the FileGroup is created, so the first index reads the corrected file — no re-index plumbing needed. Complements the client-side fix in #543 (which centers captions in the player for existing/any-source files); this makes new YouTube downloads correct at the source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| channel | ||
| test | ||
| video | ||
| __init__.py | ||
| api.py | ||
| common.py | ||
| conftest.py | ||
| cookies.py | ||
| downloader.py | ||
| errors.py | ||
| lib.py | ||
| models.py | ||
| normalize_video_url.py | ||
| schema.py | ||