Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
def run_katana(url):
|
5 |
+
output_file = "urls.txt"
|
6 |
+
command = f"katana -u {url} > {output_file}"
|
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)
|