Jarvis-Brain 0.1.11.4__tar.gz → 0.1.11.5__tar.gz
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.
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/PKG-INFO +1 -1
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/pyproject.toml +1 -1
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/tools/browser_proxy.py +0 -41
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/.gitignore +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/README.md +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/mcp_tools/__init__.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/mcp_tools/dp_tools.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/mcp_tools/main.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/tools/__init__.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/tools/browser_manager.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/tools/tools.py +0 -0
- {jarvis_brain-0.1.11.4 → jarvis_brain-0.1.11.5}/uv.lock +0 -0
|
@@ -171,47 +171,6 @@ def check_data_packet(packet: DataPacket, client: DPProxyClient):
|
|
|
171
171
|
client.packet_queue.append(temp_dict)
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
def check_data_packet(packet: DataPacket, client: DPProxyClient):
|
|
175
|
-
"""
|
|
176
|
-
封装监听到的数据包,并将其存放在client的packet_queue中
|
|
177
|
-
:param packet:
|
|
178
|
-
:param client:
|
|
179
|
-
:return:
|
|
180
|
-
"""
|
|
181
|
-
url = packet.url
|
|
182
|
-
method = packet.request.method
|
|
183
|
-
data = None
|
|
184
|
-
if packet.request.hasPostData:
|
|
185
|
-
data = packet.request.postData
|
|
186
|
-
domain = urlparse(url).netloc
|
|
187
|
-
body = packet.response.body
|
|
188
|
-
body_str = json.dumps(body, ensure_ascii=False, separators=(',', ':'))
|
|
189
|
-
body_str_list = [body_str[i:i + one_turn_max_token] for i in range(0, len(body_str), one_turn_max_token)]
|
|
190
|
-
body_completed = True
|
|
191
|
-
packet_filter = client.packet_filter
|
|
192
|
-
domain_filter = packet_filter.get("domain_filter", None)
|
|
193
|
-
method_filter = packet_filter.get("method_filter", ["GET", "POST"])
|
|
194
|
-
for index, body_str in enumerate(body_str_list):
|
|
195
|
-
# 如果给了domain_filter并且domain没有在domain_filter中时跳过该数据包
|
|
196
|
-
if domain_filter and domain not in domain_filter:
|
|
197
|
-
continue
|
|
198
|
-
# 如果method没有在method_filter中,则跳过该数据包
|
|
199
|
-
if method not in method_filter:
|
|
200
|
-
continue
|
|
201
|
-
if (index + 1) != len(body_str_list):
|
|
202
|
-
body_completed = False
|
|
203
|
-
temp_dict = {
|
|
204
|
-
"url": url,
|
|
205
|
-
"body_completed": body_completed,
|
|
206
|
-
"method": method,
|
|
207
|
-
"request_data": data,
|
|
208
|
-
"request_headers": dict(packet.request.headers),
|
|
209
|
-
"response_headers": dict(packet.response.headers),
|
|
210
|
-
"response_body_segment": body_str.replace("\\", ""),
|
|
211
|
-
}
|
|
212
|
-
client.packet_queue.append(temp_dict)
|
|
213
|
-
|
|
214
|
-
|
|
215
174
|
client_manager = DPProxyClientManager()
|
|
216
175
|
|
|
217
176
|
# if __name__ == '__main__':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|