Spaces:
Sleeping
Sleeping
gradio fix
Browse files
app.py
CHANGED
|
@@ -157,44 +157,41 @@ You can now download the ZIP file below.
|
|
| 157 |
|
| 158 |
|
| 159 |
# ===========================================================
|
| 160 |
-
# 🎨
|
| 161 |
# ===========================================================
|
| 162 |
|
| 163 |
def run_extraction(url, max_links, depth):
|
| 164 |
return extract_all_content_as_zip(url, int(max_links), int(depth))
|
| 165 |
|
| 166 |
|
| 167 |
-
with gr.Blocks(
|
| 168 |
|
| 169 |
gr.Markdown("""
|
| 170 |
# 🌍 Website Content & PDF Extractor
|
| 171 |
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
Perfect for:
|
| 175 |
-
• Research
|
| 176 |
-
• Archiving documentation
|
| 177 |
-
• Creating AI knowledge bases
|
| 178 |
-
• Offline reading
|
| 179 |
""")
|
| 180 |
|
|
|
|
|
|
|
| 181 |
with gr.Box():
|
| 182 |
gr.Markdown("## 🧭 How to use")
|
| 183 |
|
| 184 |
gr.Markdown("""
|
| 185 |
-
1️⃣ Enter
|
| 186 |
-
2️⃣ Choose how deep
|
| 187 |
3️⃣ Click **Start Extraction**
|
| 188 |
4️⃣ Download your ZIP file
|
| 189 |
|
| 190 |
-
⚠️ Large
|
| 191 |
""")
|
| 192 |
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
|
|
|
| 198 |
|
| 199 |
with gr.Row():
|
| 200 |
max_links_input = gr.Slider(
|
|
@@ -222,8 +219,12 @@ Perfect for:
|
|
| 222 |
|
| 223 |
|
| 224 |
# ===========================================================
|
| 225 |
-
# 🚀 ENTRY POINT
|
| 226 |
# ===========================================================
|
| 227 |
|
| 228 |
if __name__ == "__main__":
|
| 229 |
-
app.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
|
| 159 |
# ===========================================================
|
| 160 |
+
# 🎨 GRADIO WEB APP (Gradio 6 FIXED)
|
| 161 |
# ===========================================================
|
| 162 |
|
| 163 |
def run_extraction(url, max_links, depth):
|
| 164 |
return extract_all_content_as_zip(url, int(max_links), int(depth))
|
| 165 |
|
| 166 |
|
| 167 |
+
with gr.Blocks(title="Website Content Extractor") as app:
|
| 168 |
|
| 169 |
gr.Markdown("""
|
| 170 |
# 🌍 Website Content & PDF Extractor
|
| 171 |
|
| 172 |
+
Download the **text and PDFs from a website** and package everything into a ZIP file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
""")
|
| 174 |
|
| 175 |
+
gr.Markdown("---")
|
| 176 |
+
|
| 177 |
with gr.Box():
|
| 178 |
gr.Markdown("## 🧭 How to use")
|
| 179 |
|
| 180 |
gr.Markdown("""
|
| 181 |
+
1️⃣ Enter a website homepage
|
| 182 |
+
2️⃣ Choose how deep to crawl
|
| 183 |
3️⃣ Click **Start Extraction**
|
| 184 |
4️⃣ Download your ZIP file
|
| 185 |
|
| 186 |
+
⚠️ Large sites may take several minutes.
|
| 187 |
""")
|
| 188 |
|
| 189 |
+
gr.Markdown("---")
|
| 190 |
+
|
| 191 |
+
url_input = gr.Textbox(
|
| 192 |
+
label="Website URL",
|
| 193 |
+
placeholder="https://example.com"
|
| 194 |
+
)
|
| 195 |
|
| 196 |
with gr.Row():
|
| 197 |
max_links_input = gr.Slider(
|
|
|
|
| 219 |
|
| 220 |
|
| 221 |
# ===========================================================
|
| 222 |
+
# 🚀 ENTRY POINT (GRADIO 6 FIX)
|
| 223 |
# ===========================================================
|
| 224 |
|
| 225 |
if __name__ == "__main__":
|
| 226 |
+
app.launch(
|
| 227 |
+
server_name="0.0.0.0",
|
| 228 |
+
server_port=7860,
|
| 229 |
+
theme=gr.themes.Soft()
|
| 230 |
+
)
|