fix(windows): improve yt-dlp filename safety without changing defaults#100
Conversation
Add --windows-filenames on Windows and compute --trim-filenames from the output directory length so long Facebook/Instagram titles stay within path limits. Keeps the existing %(title)s output template unchanged.
|
Thanks, this PR looks much better scoped than the previous filename change. I’m okay with the overall direction: keeping the existing output template, avoiding new settings UI, and only hardening the backend filename safety path is the right approach. Two small changes before merge:
After those two small adjustments, this should be good to merge. |
Address PR review: keep the effective --trim-filenames cap at 180 for short output paths, and use output_path.as_bytes().len() so non-ASCII folder names reserve path space correctly.
Done — capped trim at 180 and switched path length to byte count. Thanks for the review! |
Summary
--windows-filenameson Windows so yt-dlp replaces invalid characters before writing files--trim-filenamesfrom the output directory length instead of a fixed 180 bytes%(title)s.%(ext)sand metadata sidecar naming unchangedNarrow follow-up to #97 per maintainer feedback: only harden existing safe filename args, without changing default templates, ASCII restrictions, or settings UI.
Test plan
cargo test filename --libcargo checkbun run tsc -b