Spaces:
Sleeping
Sleeping
Update app.py
Browse filesUpdate DDGS dependency
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
| 3 |
import requests
|
| 4 |
import os
|
| 5 |
import zipfile
|
|
@@ -32,7 +32,7 @@ def scrape_and_zip_images(search_term, max_images=500):
|
|
| 32 |
max_images = min(max_images, 500)
|
| 33 |
|
| 34 |
results = ddgs.images(
|
| 35 |
-
|
| 36 |
region="wt-wt",
|
| 37 |
safesearch="moderate",
|
| 38 |
max_results=max_images
|
|
@@ -156,6 +156,7 @@ with gr.Blocks(title="DuckDuckGo Image Scraper") as demo:
|
|
| 156 |
- The actual number of images downloaded may be less than requested due to rate limits or availability
|
| 157 |
- Images are temporarily stored during processing and deleted after zipping
|
| 158 |
- Download may take some time depending on the number of images
|
|
|
|
| 159 |
""")
|
| 160 |
|
| 161 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from ddgs import DDGS
|
| 3 |
import requests
|
| 4 |
import os
|
| 5 |
import zipfile
|
|
|
|
| 32 |
max_images = min(max_images, 500)
|
| 33 |
|
| 34 |
results = ddgs.images(
|
| 35 |
+
query=search_term,
|
| 36 |
region="wt-wt",
|
| 37 |
safesearch="moderate",
|
| 38 |
max_results=max_images
|
|
|
|
| 156 |
- The actual number of images downloaded may be less than requested due to rate limits or availability
|
| 157 |
- Images are temporarily stored during processing and deleted after zipping
|
| 158 |
- Download may take some time depending on the number of images
|
| 159 |
+
- Uses the updated `ddgs` package (formerly `duckduckgo_search`)
|
| 160 |
""")
|
| 161 |
|
| 162 |
if __name__ == "__main__":
|