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