chatgpt-mirai-qq-bot-web-search 0.2.13__py3-none-any.whl → 0.2.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chatgpt-mirai-qq-bot-web-search
3
- Version: 0.2.13
3
+ Version: 0.2.14
4
4
  Summary: WebSearch adapter for lss233/chatgpt-mirai-qq-bot
5
5
  Home-page: https://github.com/chuanSir123/web_search
6
6
  Author: chuanSir
@@ -1,11 +1,11 @@
1
1
  web_search/__init__.py,sha256=_vfIxeLqXc53QoZ8sHzw_SbGkxb2CTRQdd1phQmC8GM,6147
2
2
  web_search/blocks.py,sha256=QuXt3KMuY4hUW-ucleNYXFvW6YbUAB4Xu4m_SxdCd-U,9152
3
3
  web_search/config.py,sha256=DhLiERBJR2V5Boglf7Aq9Rbc4vsvLIh67CrLDIPeqA0,398
4
- web_search/web_searcher.py,sha256=ShGgN-z-X3LJN8wm8iMK_FqdwmicgXKqy2PmcIYJYJY,21382
4
+ web_search/web_searcher.py,sha256=gYfD0K4_zTIn0pDbB2BABpw7poFuAC4mohJmQWL-3I4,21285
5
5
  web_search/example/roleplayWithWebSearch.yaml,sha256=C-dGy3z8gcRcmxzurssP-kPRLqMf1TYR-nnNUaJjISE,7468
6
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
7
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/METADATA,sha256=mN9zzmyTTTPsvPXyHVCnU8WDEKLB_DVReuEukpuN7Xw,1735
8
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/entry_points.txt,sha256=o3kRDSdSmSdnCKlK6qS57aN0WpI4ab-Nxub2NwUrjf0,64
10
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/top_level.txt,sha256=PoNm8MJYw_y8RTMaNlY0ePLoNHxVUAE2IHDuL5fFubI,11
11
- chatgpt_mirai_qq_bot_web_search-0.2.13.dist-info/RECORD,,
6
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
7
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/METADATA,sha256=Li4wXJNuG8jkqSQM3-EuR_X4Fx7qmopEViUjwxlzpDE,1735
8
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/entry_points.txt,sha256=o3kRDSdSmSdnCKlK6qS57aN0WpI4ab-Nxub2NwUrjf0,64
10
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/top_level.txt,sha256=PoNm8MJYw_y8RTMaNlY0ePLoNHxVUAE2IHDuL5fFubI,11
11
+ chatgpt_mirai_qq_bot_web_search-0.2.14.dist-info/RECORD,,
@@ -62,10 +62,8 @@ class WebSearcher:
62
62
  async def _ensure_initialized(self,proxy):
63
63
  """确保浏览器已初始化"""
64
64
  try:
65
- if self.context:
66
- return self.context
67
- self.playwright = await async_playwright().start()
68
65
 
66
+ self.playwright = await async_playwright().start()
69
67
  # 创建用户数据目录路径
70
68
  user_data_dir = os.path.join(os.path.expanduser("~"), ".playwright_user_data")+f'{random.randint(1, 1000000)}'
71
69
  os.makedirs(user_data_dir, exist_ok=True)
@@ -106,7 +104,6 @@ class WebSearcher:
106
104
  user_data_dir=user_data_dir,
107
105
  **context_options
108
106
  )
109
-
110
107
  self.browser = None # 不再需要单独的browser引用
111
108
 
112
109
  except Exception as e:
@@ -148,7 +145,6 @@ class WebSearcher:
148
145
 
149
146
  except Exception as e:
150
147
  logger.error(f"Failed to initialize WebSearcher: {e}")
151
- await self.close()
152
148
  raise
153
149
 
154
150
  async def simulate_human_scroll(self, page):