wet-mcp 1.2.1__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wet-mcp
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: Open-source MCP Server thay thế Tavily - Web search, extract, crawl với SearXNG
5
5
  Project-URL: Homepage, https://github.com/n24q02m/wet-mcp
6
6
  Project-URL: Repository, https://github.com/n24q02m/wet-mcp.git
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "wet-mcp"
3
- version = "1.2.1"
3
+ version = "1.3.0"
4
4
  description = "Open-source MCP Server thay thế Tavily - Web search, extract, crawl với SearXNG"
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -288,10 +288,21 @@ async def download_media(
288
288
 
289
289
  results = []
290
290
 
291
- async with httpx.AsyncClient(timeout=60) as client:
291
+ transport = httpx.AsyncHTTPTransport(retries=3)
292
+ headers = {
293
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
294
+ }
295
+
296
+ async with httpx.AsyncClient(
297
+ timeout=60, transport=transport, headers=headers
298
+ ) as client:
292
299
  for url in media_urls:
293
300
  try:
294
- response = await client.get(url)
301
+ # Handle protocol-relative URLs
302
+ if url.startswith("//"):
303
+ url = f"https:{url}"
304
+
305
+ response = await client.get(url, follow_redirects=True)
295
306
  response.raise_for_status()
296
307
 
297
308
  filename = url.split("/")[-1].split("?")[0] or "download"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes