feat: 新增平台
This commit is contained in:
@@ -32,8 +32,9 @@ class BilibiliMirParser(BaseParser):
|
||||
video_url = video_data.get("url", "") or video_data.get("video_url", "")
|
||||
title = video_data.get("title", "")
|
||||
description = video_data.get("desc", "") or video_data.get("description", "")
|
||||
author = video_data.get("author", "") or video_data.get("owner", {}).get("name", "")
|
||||
|
||||
return self._normalize_response(cover, video_url, title, description)
|
||||
return self._normalize_response(cover, video_url, title, description, author)
|
||||
else:
|
||||
raise Exception(f"解析失败: {data.get('msg', '未知错误')}")
|
||||
except Exception as e:
|
||||
@@ -70,8 +71,9 @@ class BilibiliBugPKParser(BaseParser):
|
||||
video_url = video_data.get("url", "") or video_data.get("video_url", "")
|
||||
title = video_data.get("title", "")
|
||||
description = video_data.get("desc", "") or video_data.get("description", "")
|
||||
author = video_data.get("author", "") or video_data.get("owner", {}).get("name", "")
|
||||
|
||||
return self._normalize_response(cover, video_url, title, description)
|
||||
return self._normalize_response(cover, video_url, title, description, author)
|
||||
else:
|
||||
raise Exception(f"解析失败: {data.get('msg', '未知错误')}")
|
||||
except Exception as e:
|
||||
@@ -105,6 +107,7 @@ class BilibiliYaohuParser(BaseParser):
|
||||
cover = basic.get("cover", "")
|
||||
title = basic.get("title", "")
|
||||
description = basic.get("description", "")
|
||||
author = basic.get("author", "") or basic.get("owner", {}).get("name", "")
|
||||
|
||||
# 提取视频URL - 优先使用data.video_url,其次使用videos[0].url
|
||||
video_url = video_data.get("video_url", "")
|
||||
@@ -113,7 +116,7 @@ class BilibiliYaohuParser(BaseParser):
|
||||
if isinstance(videos, list) and videos:
|
||||
video_url = videos[0].get("url", "")
|
||||
|
||||
return self._normalize_response(cover, video_url, title, description)
|
||||
return self._normalize_response(cover, video_url, title, description, author)
|
||||
else:
|
||||
raise Exception(f"解析失败: 不支持的类型 {data.get('parse_type')}")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user