Jarvis-Brain 0.1.5.4__py3-none-any.whl → 0.1.5.5__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.4
2
2
  Name: Jarvis_Brain
3
- Version: 0.1.5.4
3
+ Version: 0.1.5.5
4
4
  Summary: Jarvis brain mcp
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: beautifulsoup4
@@ -3,8 +3,8 @@ mcp_tools/dp_tools.py,sha256=TsktupVxzQkDRH4w-niEqJba3LkeWxIeyyx24ehpqAs,8411
3
3
  mcp_tools/main.py,sha256=SiLF-tcEdApkzMjTZJEpVYX5d-LPW7aqy6A6lCBA7YQ,829
4
4
  tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  tools/browser_manager.py,sha256=MrdONq-qxkDsq_xWeS5MjbUelCaB_UdQ3H79r1M1yuI,1746
6
- tools/tools.py,sha256=NMd7bSadWEh6rtw9LYg37-ZHzE28PmobE3mqFgbWdQg,5015
7
- jarvis_brain-0.1.5.4.dist-info/METADATA,sha256=blulHvE0xWUTsOrZBlfCKCSTmSlPRNZTOx9xOUD9l3w,241
8
- jarvis_brain-0.1.5.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
- jarvis_brain-0.1.5.4.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
10
- jarvis_brain-0.1.5.4.dist-info/RECORD,,
6
+ tools/tools.py,sha256=TaWs-CNXy-py9BFmCnJrQ09ke938xXpImf-N2Qo_Rvc,4708
7
+ jarvis_brain-0.1.5.5.dist-info/METADATA,sha256=dvTinD5zIVsMuiTqrpXFnHdzyTDN7ROGXKDY9G6Brx0,241
8
+ jarvis_brain-0.1.5.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
+ jarvis_brain-0.1.5.5.dist-info/entry_points.txt,sha256=YFQT4xpkUqt5dM5wlKPQQOqcjMuFrT9iuRAzIpAyH7U,51
10
+ jarvis_brain-0.1.5.5.dist-info/RECORD,,
tools/tools.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import time
2
-
2
+ import random
3
+ import os
3
4
  import minify_html
4
5
  from DrissionPage import ChromiumPage, ChromiumOptions
5
6
  from bs4 import BeautifulSoup
@@ -22,17 +23,9 @@ def dp_headless_html(url):
22
23
  opt = ChromiumOptions().headless(True)
23
24
  opt.set_argument('--no-sandbox')
24
25
  """创建新的浏览器实例"""
25
- random_port = random.randint(9223, 9934)
26
- while random_port in self.browser_pool:
27
- random_port = random.randint(9223, 9934)
28
-
26
+ random_port = random.randint(9934, 10034)
29
27
  custom_data_dir = os.path.join(os.path.expanduser('~'), 'DrissionPage', "userData", f"{random_port}")
30
28
  opt.set_user_data_path(custom_data_dir) # 设置用户数据路径
31
- # if not os.path.exists(custom_data_dir):
32
- # os.makedirs(custom_data_dir)
33
- # self.browser_pool[random_port] = ChromiumPage(co)
34
- # 随机端口,固定9222端口的话,可能会被瑞数检测到
35
- # opt.auto_port()
36
29
  opt.set_local_port(random_port)
37
30
  page = ChromiumPage(opt)
38
31
  tab = page.latest_tab