binuser007 commited on
Commit
fa89d87
·
verified ·
1 Parent(s): ee0c14d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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
- subprocess.run(command, shell=True, check=True)
9
- return output_file
 
 
 
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)