Skip to content

The only downloader you need. 下载器的集大成者。

fix: replace slashes in filenames instead of truncating basename (#812)

XiaoYouChRde21cfcf3edb
diff --git a/app/platform/filesystem.py b/app/platform/filesystem.py
index fe0e82fb..0bf4e334 100644
--- a/app/platform/filesystem.py
+++ b/app/platform/filesystem.py
@@ -18,10 +18,6 @@ WINDOWS_RESERVED_FILENAMES = {
def toSafeFilename(name: str, fallback: str = "file", maxLength: int = 200) -> str:
candidate = str(name or "")
- lastSep = max(candidate.rfind("/"), candidate.rfind("\\"))
- if lastSep >= 0:
- candidate = candidate[lastSep + 1:]
-
candidate = INVALID_FILENAME_PATTERN.sub("_", candidate).strip().rstrip(". ")
if not candidate or candidate in {".", ".."}: