Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
|
|
3 |
|
4 |
def run_katana(url):
|
5 |
output_file = "urls.txt"
|
@@ -7,13 +8,17 @@ def run_katana(url):
|
|
7 |
subprocess.run(command, shell=True, check=True)
|
8 |
return output_file
|
9 |
|
|
|
|
|
|
|
10 |
# Gradio interface
|
11 |
interface = gr.Interface(
|
12 |
fn=run_katana,
|
13 |
inputs="text",
|
14 |
outputs="file",
|
15 |
title="Katana URL Crawler",
|
16 |
-
description="Enter a URL to crawl with Katana."
|
|
|
17 |
)
|
18 |
|
19 |
interface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess
|
3 |
+
import os
|
4 |
|
5 |
def run_katana(url):
|
6 |
output_file = "urls.txt"
|
|
|
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)
|
13 |
+
|
14 |
# Gradio interface
|
15 |
interface = gr.Interface(
|
16 |
fn=run_katana,
|
17 |
inputs="text",
|
18 |
outputs="file",
|
19 |
title="Katana URL Crawler",
|
20 |
+
description="Enter a URL to crawl with Katana.",
|
21 |
+
flagging_dir="/tmp/flagged" # Specify a writable directory for flagging
|
22 |
)
|
23 |
|
24 |
interface.launch(server_name="0.0.0.0", server_port=7860)
|