更新部分爬虫以兼容本地运行及数据库存储
This commit is contained in:
@@ -93,7 +93,12 @@ async def update_weibo_note(note_item: Dict):
|
||||
"source_keyword": source_keyword_var.get(),
|
||||
}
|
||||
utils.logger.info(f"[store.weibo.update_weibo_note] weibo note id:{note_id}, title:{save_content_item.get('content')[:24]} ...")
|
||||
await WeibostoreFactory.create_store().store_content(content_item=save_content_item)
|
||||
try:
|
||||
await WeibostoreFactory.create_store().store_content(content_item=save_content_item)
|
||||
utils.logger.debug(f"[store.weibo.update_weibo_note] Successfully saved note {note_id}")
|
||||
except Exception as e:
|
||||
utils.logger.error(f"[store.weibo.update_weibo_note] Failed to save note {note_id}: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
async def batch_update_weibo_note_comments(note_id: str, comments: List[Dict]):
|
||||
@@ -148,7 +153,12 @@ async def update_weibo_note_comment(note_id: str, comment_item: Dict):
|
||||
"avatar": user_info.get("profile_image_url", ""),
|
||||
}
|
||||
utils.logger.info(f"[store.weibo.update_weibo_note_comment] Weibo note comment: {comment_id}, content: {save_comment_item.get('content', '')[:24]} ...")
|
||||
await WeibostoreFactory.create_store().store_comment(comment_item=save_comment_item)
|
||||
try:
|
||||
await WeibostoreFactory.create_store().store_comment(comment_item=save_comment_item)
|
||||
utils.logger.debug(f"[store.weibo.update_weibo_note_comment] Successfully saved comment {comment_id}")
|
||||
except Exception as e:
|
||||
utils.logger.error(f"[store.weibo.update_weibo_note_comment] Failed to save comment {comment_id}: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
async def update_weibo_note_image(picid: str, pic_content, extension_file_name):
|
||||
|
||||
Reference in New Issue
Block a user