fix(youtube): use platform-aware yt-dlp config path and locale-safe reads (#225)

This commit is contained in:
biyusku
2026-03-31 09:56:16 +03:00
committed by GitHub
parent 3e90d51da9
commit e90fbfe194
4 changed files with 96 additions and 7 deletions
+14
View File
@@ -0,0 +1,14 @@
"""UTF-8-safe text helpers for cross-platform file operations."""
from __future__ import annotations
from pathlib import Path
def read_utf8_text(path: str | Path, default: str = "") -> str:
"""Read text as UTF-8 with replacement semantics."""
target = Path(path)
if not target.exists():
return default
return target.read_text(encoding="utf-8", errors="replace")