From dfe2359a867f28cde4b824a7842d75c5a06181c6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 10 Aug 2024 06:00:38 -0700 Subject: [PATCH] feat: Implement MIME type detection in scrape methods --- aider/scrape.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/aider/scrape.py b/aider/scrape.py index 2fbbd35a4..1044468dd 100755 --- a/aider/scrape.py +++ b/aider/scrape.py @@ -94,16 +94,16 @@ class Scraper: """ if self.playwright_available: - content = self.scrape_with_playwright(url) + content, mime_type = self.scrape_with_playwright(url) else: - content = self.scrape_with_httpx(url) + content, mime_type = self.scrape_with_httpx(url) if not content: self.print_error(f"Failed to retrieve content from {url}") return None - # Check if the content is HTML - if content.strip().startswith(('