mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-06-08 02:47:26 +08:00
feat: 增加搜索词来源渠道
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
from typing import List
|
||||
|
||||
import config
|
||||
from var import source_keyword_var
|
||||
|
||||
from .bilibili_store_impl import *
|
||||
from .bilibilli_store_video import *
|
||||
@@ -48,6 +49,7 @@ async def update_bilibili_video(video_item: Dict):
|
||||
"last_modify_ts": utils.get_current_timestamp(),
|
||||
"video_url": f"https://www.bilibili.com/video/av{video_id}",
|
||||
"video_cover_url": video_item_view.get("pic", ""),
|
||||
"source_keyword": source_keyword_var.get(),
|
||||
}
|
||||
utils.logger.info(
|
||||
f"[store.bilibili.update_bilibili_video] bilibili video id:{video_id}, title:{save_content_item.get('title')}")
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
from typing import List
|
||||
|
||||
import config
|
||||
from var import source_keyword_var
|
||||
|
||||
from .douyin_store_impl import *
|
||||
|
||||
@@ -48,7 +49,8 @@ async def update_douyin_aweme(aweme_item: Dict):
|
||||
"share_count": str(interact_info.get("share_count")),
|
||||
"ip_location": aweme_item.get("ip_label", ""),
|
||||
"last_modify_ts": utils.get_current_timestamp(),
|
||||
"aweme_url": f"https://www.douyin.com/video/{aweme_id}"
|
||||
"aweme_url": f"https://www.douyin.com/video/{aweme_id}",
|
||||
"source_keyword": source_keyword_var.get(),
|
||||
}
|
||||
utils.logger.info(
|
||||
f"[store.douyin.update_douyin_aweme] douyin aweme id:{aweme_id}, title:{save_content_item.get('title')}")
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
from typing import List
|
||||
|
||||
import config
|
||||
from var import source_keyword_var
|
||||
|
||||
from .kuaishou_store_impl import *
|
||||
|
||||
@@ -46,6 +47,7 @@ async def update_kuaishou_video(video_item: Dict):
|
||||
"video_url": f"https://www.kuaishou.com/short-video/{video_id}",
|
||||
"video_cover_url": photo_info.get("coverUrl", ""),
|
||||
"video_play_url": photo_info.get("photoUrl", ""),
|
||||
"source_keyword": source_keyword_var.get(),
|
||||
}
|
||||
utils.logger.info(
|
||||
f"[store.kuaishou.update_kuaishou_video] Kuaishou video id:{video_id}, title:{save_content_item.get('title')}")
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from typing import List
|
||||
|
||||
from model.m_baidu_tieba import TiebaComment, TiebaNote
|
||||
from var import source_keyword_var
|
||||
|
||||
from . import tieba_store_impl
|
||||
from .tieba_store_impl import *
|
||||
@@ -32,6 +33,7 @@ async def update_tieba_note(note_item: TiebaNote):
|
||||
Returns:
|
||||
|
||||
"""
|
||||
note_item.source_keyword = source_keyword_var.get()
|
||||
save_note_item = note_item.model_dump()
|
||||
save_note_item.update({"last_modify_ts": utils.get_current_timestamp()})
|
||||
utils.logger.info(f"[store.tieba.update_tieba_note] tieba note: {save_note_item}")
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
from var import source_keyword_var
|
||||
from .weibo_store_image import *
|
||||
from .weibo_store_impl import *
|
||||
|
||||
@@ -51,6 +52,8 @@ async def update_weibo_note(note_item: Dict):
|
||||
"gender": user_info.get("gender", ""),
|
||||
"profile_url": user_info.get("profile_url", ""),
|
||||
"avatar": user_info.get("profile_image_url", ""),
|
||||
|
||||
"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]} ...")
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
from typing import List
|
||||
|
||||
import config
|
||||
from var import source_keyword_var
|
||||
|
||||
from . import xhs_store_impl
|
||||
from .xhs_store_image import *
|
||||
@@ -78,6 +79,7 @@ async def update_xhs_note(note_item: Dict):
|
||||
"tag_list": ','.join([tag.get('name', '') for tag in tag_list if tag.get('type') == 'topic']),
|
||||
"last_modify_ts": utils.get_current_timestamp(),
|
||||
"note_url": f"https://www.xiaohongshu.com/explore/{note_id}?xsec_token={note_item.get('xsec_token')}&xsec_source=pc_search",
|
||||
"source_keyword": source_keyword_var.get(),
|
||||
}
|
||||
utils.logger.info(f"[store.xhs.update_xhs_note] xhs note: {local_db_item}")
|
||||
await XhsStoreFactory.create_store().store_content(local_db_item)
|
||||
|
||||
Reference in New Issue
Block a user