Skip to content

Fix URL downloads with trailing-dot titles on Windows - #1602

Merged
raivisdejus merged 2 commits into
chidiwilliams:mainfrom
raylei50653:fix/url-download-windows-path
Sep 5, 2026
Merged

raivisdejus merged 2 commits into
chidiwilliams:mainfrom
raylei50653:fix/url-download-windows-path

Conversation

@raylei50653

@raylei50653 raylei50653 commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • stop deriving URL-download working paths from media titles
  • use yt-dlp's reported filepath as the ffmpeg input
  • validate both ffmpeg's exit code and the existence of its WAV output
  • keep the original remote title as display metadata
  • sanitize the title only when materializing user-visible export filenames
  • preserve title-based names for automatic TXT/SRT/VTT and speaker DOCX exports instead of falling back to audio.*

Root cause

Buzz replaced several Windows-invalid characters in the title, but did not normalize trailing dots or spaces. For a title ending in CVSS9., Buzz expected that literal path while yt-dlp's Windows path sanitizer created CVSS9#. ffmpeg therefore received a nonexistent input path.

The failure was then masked because Buzz treated empty stderr as success instead of checking returncode. With -loglevel panic, ffmpeg could exit nonzero without stderr, so Buzz assigned a nonexistent WAV path and Whisper/PyAV failed later.

Path boundaries

This change separates three concepts:

  • remote title: preserved exactly as display/document metadata
  • internal working path: fixed safe names such as source.%(ext)s and audio.wav
  • exported filename: derived from the title through one portable filename-component sanitizer

The sanitizer covers Windows-invalid characters, trailing dots/spaces, control characters, and reserved device names. Speaker DOCX files use the sanitized stem for the filesystem path while retaining the original title inside the document.

Regression coverage

Covers Chinese titles, invalid characters, trailing dots, trailing spaces, emoji, reserved Windows names, yt-dlp-reported paths, nonzero ffmpeg exits with empty stderr, missing WAV output, title-based regular exports, and speaker DOCX default paths.

Tested with uv: 35 targeted tests passed, and Ruff passed.

@codecov

codecov Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.84615% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.52%. Comparing base (9775971) to head (8f4fdcf).

Files with missing lines Patch % Lines
buzz/transcriber/file_transcriber.py 93.02% 3 Missing ⚠️
buzz/paths.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1602      +/-   ##
==========================================
+ Coverage   83.44%   83.52%   +0.08%     
==========================================
  Files         111      111              
  Lines       12648    12683      +35     
==========================================
+ Hits        10554    10594      +40     
+ Misses       2094     2089       -5     
Flag Coverage Δ
Linux 82.72% <93.84%> (+0.07%) ⬆️
macOS 83.04% <93.84%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raivisdejus

Copy link
Copy Markdown
Collaborator

@raylei50653 Thanks for your contribution

@raivisdejus
raivisdejus merged commit 4c18d46 into chidiwilliams:main Sep 5, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants