Closed oorsuioi closed 1 month ago
fix it
fix it
请问怎么解决的?这个code每次都不一样的
async def fetch_creator_notes_detail(self, note_list: List[Dict]):
"""
Concurrently obtain the specified post list and save the data
"""
semaphore = asyncio.Semaphore(config.MAX_CONCURRENCY_NUM)
task_list = [
self.get_note_detail(
note_id=post_item.get("id"),
xsec_source=post_item.get("xsec_source"),
xsec_token=post_item.get("xsec_token"),
semaphore=semaphore
)
for post_item in note_list
]
note_details = await asyncio.gather(*task_list)
for note_detail in note_details:
if note_detail:
await xhs_store.update_xhs_note(note_detail)
此处 _note_id=postitem.get("id"), 是不是应该是 _note_id=post_item.get("noteid"), 呀
新update后的代码运行会报 source_note_id not found的报错,我追踪到这里,尝试修改以后就能跑通了。麻烦作者大大check一下
async def fetch_creator_notes_detail(self, note_list: List[Dict]): """ Concurrently obtain the specified post list and save the data """ semaphore = asyncio.Semaphore(config.MAX_CONCURRENCY_NUM) task_list = [ self.get_note_detail( note_id=post_item.get("id"), xsec_source=post_item.get("xsec_source"), xsec_token=post_item.get("xsec_token"), semaphore=semaphore ) for post_item in note_list ] note_details = await asyncio.gather(*task_list) for note_detail in note_details: if note_detail: await xhs_store.update_xhs_note(note_detail)
此处 _note_id=postitem.get("id"), 是不是应该是 _note_id=post_item.get("noteid"), 呀
新update后的代码运行会报 source_note_id not found的报错,我追踪到这里,尝试修改以后就能跑通了。麻烦作者大大check一下
确实有问题,你可以贡献代码,但是修复这个 bug 的时候,复制错了。
提交了pull request啦大大😊
360 提交了pull request啦大大😊
已合,感谢贡献
麻烦问一下xsec_token这个东西是怎么获取的,没太理解,多谢多谢
/api/sns/web/v1/feed"接口参数变了 需要添加 xsec_token,xsec_token 可以再搜索接口拿到
async def get_note_by_id(self, note_id: str, xsec_token: str) -> Dict: """ 获取笔记详情API Args: note_id:笔记ID