fix(download): return author name instead of mid in _extract_author
PR Test / lint (pull_request) Successful in 1s

- Fix download processor to return actual author name (e.g. "HOLA小测佬")
  instead of B站用户ID (mid, e.g. "406636263")
- Add 5 test cases for author extraction logic
- Resolves report display issue where UP主名称 showed numeric ID

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 13:50:02 +08:00
parent 2dce679cca
commit ee0fc74378
2 changed files with 97 additions and 4 deletions
+4 -4
View File
@@ -216,13 +216,13 @@ class DownloadProcessor(BaseProcessor):
platform: Platform name
Returns:
Author string
Author string (author name, not mid)
"""
if platform == "bilibili":
# Bilibili metadata structure: {metadata: {mid: ...}, ...}
# Bilibili metadata structure: {metadata: {author: ..., mid: ...}, ...}
if "metadata" in metadata:
return str(metadata["metadata"].get("mid", ""))
return str(metadata.get("mid", ""))
return str(metadata["metadata"].get("author", ""))
return str(metadata.get("author", ""))
else:
return metadata.get("author", "")