refactor: xhs add log
This commit is contained in:
parent
e2aaf0e5c1
commit
2e032d09dc
|
@ -100,6 +100,7 @@ PS:如果打赏时请备注捐赠者,如有遗漏请联系我添加(有时
|
||||||
|
|
||||||
| 捐赠者 | 捐赠金额 | 捐赠日期 |
|
| 捐赠者 | 捐赠金额 | 捐赠日期 |
|
||||||
|---------|--------|------------|
|
|---------|--------|------------|
|
||||||
|
| xiongot | 20 元 | 2023-12-17 |
|
||||||
| atom.hu | 20 元 | 2023-12-16 |
|
| atom.hu | 20 元 | 2023-12-16 |
|
||||||
| 一呆 | 20 元 | 2023-12-01 |
|
| 一呆 | 20 元 | 2023-12-01 |
|
||||||
| 坠落 | 50 元 | 2023-11-08 |
|
| 坠落 | 50 元 | 2023-11-08 |
|
||||||
|
|
|
@ -136,6 +136,7 @@ class XHSClient:
|
||||||
if res and res.get("items"):
|
if res and res.get("items"):
|
||||||
res_dict: Dict = res["items"][0]["note_card"]
|
res_dict: Dict = res["items"][0]["note_card"]
|
||||||
return res_dict
|
return res_dict
|
||||||
|
utils.logger.error("[xhs.client.get_note_by_id] get note empty and res:", res)
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
async def get_note_comments(self, note_id: str, cursor: str = "") -> Dict:
|
async def get_note_comments(self, note_id: str, cursor: str = "") -> Dict:
|
||||||
|
|
|
@ -102,6 +102,7 @@ class XiaoHongShuCrawler(AbstractCrawler):
|
||||||
keyword=keyword,
|
keyword=keyword,
|
||||||
page=page,
|
page=page,
|
||||||
)
|
)
|
||||||
|
utils.logger.info("Search notes res:", notes_res)
|
||||||
semaphore = asyncio.Semaphore(config.MAX_CONCURRENCY_NUM)
|
semaphore = asyncio.Semaphore(config.MAX_CONCURRENCY_NUM)
|
||||||
task_list = [
|
task_list = [
|
||||||
self.get_note_detail(post_item.get("id"), semaphore)
|
self.get_note_detail(post_item.get("id"), semaphore)
|
||||||
|
|
Loading…
Reference in New Issue