Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,13 @@ import subprocess
|
|
3 |
import os
|
4 |
|
5 |
def run_katana(url):
|
6 |
-
output_file = "urls.txt"
|
7 |
command = f"katana -u {url} > {output_file}"
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
# Ensure the /tmp/flagged directory exists
|
12 |
os.makedirs("/tmp/flagged", exist_ok=True)
|
|
|
3 |
import os
|
4 |
|
5 |
def run_katana(url):
|
6 |
+
output_file = "/tmp/urls.txt" # Use /tmp for writable directory
|
7 |
command = f"katana -u {url} > {output_file}"
|
8 |
+
try:
|
9 |
+
subprocess.run(command, shell=True, check=True)
|
10 |
+
return output_file
|
11 |
+
except subprocess.CalledProcessError as e:
|
12 |
+
return f"Error running katana: {e}"
|
13 |
|
14 |
# Ensure the /tmp/flagged directory exists
|
15 |
os.makedirs("/tmp/flagged", exist_ok=True)
|