diff --git a/media_platform/bilibili/core.py b/media_platform/bilibili/core.py index af7aa0b..fbd0651 100644 --- a/media_platform/bilibili/core.py +++ b/media_platform/bilibili/core.py @@ -176,7 +176,7 @@ class BilibiliCrawler(AbstractCrawler): except DataFetchError as ex: utils.logger.error(f"[get_comments] get video_id: {video_id} comment error: {ex}") except Exception as e: - utils.logger.error(f"[get_comments] may be been blocked, err:", e) + utils.logger.error(f"[get_comments] may be been blocked, err:{e}") async def get_specified_videos(self): """ diff --git a/media_platform/kuaishou/core.py b/media_platform/kuaishou/core.py index f3f55a2..b1ed310 100644 --- a/media_platform/kuaishou/core.py +++ b/media_platform/kuaishou/core.py @@ -172,7 +172,7 @@ class KuaishouCrawler(AbstractCrawler): except DataFetchError as ex: utils.logger.error(f"[get_comments] get video_id: {video_id} comment error: {ex}") except Exception as e: - utils.logger.error(f"[get_comments] may be been blocked, err:", e) + utils.logger.error(f"[get_comments] may be been blocked, err:{e}") # use time.sleeep block main coroutine instead of asyncio.sleep and cacel running comment task # maybe kuaishou block our request, we will take a nap and update the cookie again current_running_tasks = comment_tasks_var.get() diff --git a/media_platform/xhs/client.py b/media_platform/xhs/client.py index 698534b..1d96986 100644 --- a/media_platform/xhs/client.py +++ b/media_platform/xhs/client.py @@ -136,7 +136,7 @@ class XHSClient: if res and res.get("items"): res_dict: Dict = res["items"][0]["note_card"] return res_dict - utils.logger.error("[xhs.client.get_note_by_id] get note empty and res:", res) + utils.logger.error(f"[xhs.client.get_note_by_id] get note empty and res:{res}") return dict() async def get_note_comments(self, note_id: str, cursor: str = "") -> Dict: diff --git a/media_platform/xhs/core.py b/media_platform/xhs/core.py index c4862bb..a33c929 100644 --- a/media_platform/xhs/core.py +++ b/media_platform/xhs/core.py @@ -102,7 +102,7 @@ class XiaoHongShuCrawler(AbstractCrawler): keyword=keyword, page=page, ) - utils.logger.info("Search notes res:", notes_res) + utils.logger.info(f"Search notes res:{notes_res}") semaphore = asyncio.Semaphore(config.MAX_CONCURRENCY_NUM) task_list = [ self.get_note_detail(post_item.get("id"), semaphore)