|
|
@@ -51,13 +51,11 @@ def save_json(path: Path, data: Dict[str, Any]) -> None:
|
|
|
def build_decode_input(video_data: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
"""根据视频数据构造 DecodeWorkflow 的输入结构"""
|
|
|
return {
|
|
|
- "video": video_data.get("video", ""),
|
|
|
- "video_id": video_data.get("video_id", "") or video_data.get("channel_content_id", ""), # 兼容旧字段名
|
|
|
+ "video_url": video_data.get("video_url", ""),
|
|
|
+ "video_id": video_data.get("video_id", ""),
|
|
|
"title": video_data.get("title", ""),
|
|
|
- "body_text": video_data.get("body_text", ""),
|
|
|
}
|
|
|
|
|
|
-
|
|
|
def main() -> None:
|
|
|
"""主函数"""
|
|
|
base_dir = Path(__file__).parent
|
|
|
@@ -97,8 +95,8 @@ def main() -> None:
|
|
|
existing_results: List[Dict[str, Any]] = output_data.get("results", []) or []
|
|
|
# 用 video_id + video URL 去重,避免重复处理(兼容旧字段名 channel_content_id)
|
|
|
processed_keys = {
|
|
|
- f"{item.get('video_data', {}).get('video_id', '') or item.get('video_data', {}).get('channel_content_id', '')}|"
|
|
|
- f"{item.get('video_data', {}).get('video', '')}"
|
|
|
+ f"{item.get('video_data', {}).get('video_id', '')}|"
|
|
|
+ f"{item.get('video_data', {}).get('video_url', '')}"
|
|
|
for item in existing_results
|
|
|
}
|
|
|
|
|
|
@@ -109,7 +107,7 @@ def main() -> None:
|
|
|
|
|
|
# 处理每个视频
|
|
|
for idx, video_data in enumerate(video_list, 1):
|
|
|
- video_url = video_data.get("video", "")
|
|
|
+ video_url = video_data.get("video_url", "")
|
|
|
video_id = video_data.get("video_id", "") or video_data.get("channel_content_id", "") # 兼容旧字段名
|
|
|
title = video_data.get("title", "")
|
|
|
|