fix: Strip '#' from sanitized filenames to prevent broken clip URLs

YouTube titles containing '#' (e.g. hashtags like #shorts) were saved to disk correctly, but the browser parses '#' as a URL fragment, so the frontend could never request the actual file and clips appeared missing. Add '#' to the regex in sanitize_filename().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
juancarlos.cavero 2026-04-30 07:05:27 +02:00
parent dc93df40b0
commit 6a83ebdcd7

View file

@ -444,7 +444,7 @@ def get_video_resolution(video_path):
def sanitize_filename(filename):
"""Remove invalid characters from filename."""
filename = re.sub(r'[<>:"/\\|?*]', '', filename)
filename = re.sub(r'[<>:"/\\|?*#]', '', filename)
filename = filename.replace(' ', '_')
return filename[:100]