diff options
Diffstat (limited to 'src/ollama_web/tools/scrape.py')
| -rw-r--r-- | src/ollama_web/tools/scrape.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ollama_web/tools/scrape.py b/src/ollama_web/tools/scrape.py index 2f85c38..aa79793 100644 --- a/src/ollama_web/tools/scrape.py +++ b/src/ollama_web/tools/scrape.py @@ -80,6 +80,10 @@ def scrape_url(url: str, max_chars: int | None = None, continue_from: str | None except Exception as exc: # noqa: BLE001 return f"Failed to fetch {url}: {exc}" + media_type = content_type.split(";", 1)[0].strip().lower() + if media_type.startswith(("image/", "audio/", "video/")): + return f"Unsupported content type for text scraping: {media_type}." + cleaned = extract_readable_text(data, content_type) if not cleaned: |
