Skip to content

Commit

Permalink
fix: 修复日志打印时参数格式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
NanmiCoder committed Dec 22, 2023
1 parent bced7f6 commit 273c9a3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion media_platform/bilibili/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async def get_comments(self, video_id: str, semaphore: asyncio.Semaphore):
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):
"""
Expand Down
2 changes: 1 addition & 1 deletion media_platform/kuaishou/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async def get_comments(self, video_id: str, semaphore: asyncio.Semaphore):
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()
Expand Down
2 changes: 1 addition & 1 deletion media_platform/xhs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def get_note_by_id(self, note_id: str) -> Dict:
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:
Expand Down
2 changes: 1 addition & 1 deletion media_platform/xhs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def search(self) -> None:
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)
Expand Down

0 comments on commit 273c9a3

Please sign in to comment.