fix(download): return author name instead of mid in _extract_author
PR Test / lint (pull_request) Successful in 1s
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:
@@ -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", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user