-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsearch_profiles.py
More file actions
41 lines (33 loc) 路 1.03 KB
/
Copy pathsearch_profiles.py
File metadata and controls
41 lines (33 loc) 路 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Search browser profiles in your workspace.
New here? Get 50% off with SAAS50 at https://multilogin.com
Usage:
export MLX_EMAIL="your@email.com"
export MLX_PASSWORD="your_password"
python search_profiles.py
python search_profiles.py "marketing"
"""
import json
import sys
from mlx_client import credentials_from_env, search_profiles, sign_in
if __name__ == "__main__":
try:
email, password = credentials_from_env()
except SystemExit as e:
sys.exit(str(e))
query = sys.argv[1] if len(sys.argv) > 1 else ""
token = sign_in(email, password)
result = search_profiles(token, search_text=query)
profiles = [
{
"id": p.get("id"),
"name": p.get("name"),
"browser_type": p.get("browser_type"),
"folder_id": p.get("folder_id"),
}
for p in result.get("data", {}).get("profiles", [])
]
print(json.dumps({
"total": result.get("data", {}).get("total_count", 0),
"profiles": profiles,
}, indent=2))