Spaces:
Sleeping
Sleeping
Commit ·
da02e8f
1
Parent(s): 64fe377
Fix sherlock execution path error using subprocess.run
Browse files- pages/1_BUS.py +16 -10
pages/1_BUS.py
CHANGED
|
@@ -80,17 +80,23 @@ if st.button("Lancer Ba7ath Username Search", key="ba7ath_btn"):
|
|
| 80 |
if not username or not selected_sites:
|
| 81 |
st.warning("Remplissez tous les champs.")
|
| 82 |
else:
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
with st.spinner("Analyse en cours sur plus de 400 plateformes... Cela peut prendre 2 à 4 minutes, merci de patienter."):
|
| 93 |
-
|
|
|
|
|
|
|
| 94 |
st.session_state["last_result"] = result
|
| 95 |
found_links = {}
|
| 96 |
for line in result.splitlines():
|
|
|
|
| 80 |
if not username or not selected_sites:
|
| 81 |
st.warning("Remplissez tous les champs.")
|
| 82 |
else:
|
| 83 |
+
sites_args = []
|
| 84 |
+
if len(selected_sites) != len(ALL_SITES):
|
| 85 |
+
for site in selected_sites:
|
| 86 |
+
sites_args.extend(["--site", site])
|
| 87 |
+
|
| 88 |
+
command = [
|
| 89 |
+
sys.executable, "-m", "sherlock_project.sherlock",
|
| 90 |
+
username, *sites_args, "--timeout", str(timeout), "--print-found", "--no-color"
|
| 91 |
+
]
|
| 92 |
+
|
| 93 |
+
cmd_str = " ".join(command)
|
| 94 |
+
st.info(f"Commande lancée : {cmd_str}")
|
| 95 |
+
|
| 96 |
with st.spinner("Analyse en cours sur plus de 400 plateformes... Cela peut prendre 2 à 4 minutes, merci de patienter."):
|
| 97 |
+
# On utilise subprocess.run avec cwd pour que sherlock trouve son module interne sans erreur
|
| 98 |
+
proc = subprocess.run(command, cwd=SHERLOCK_DIR, capture_output=True, text=True)
|
| 99 |
+
result = proc.stdout + "\n" + proc.stderr
|
| 100 |
st.session_state["last_result"] = result
|
| 101 |
found_links = {}
|
| 102 |
for line in result.splitlines():
|