From 7155778eac65d9e9d7b09a4e6a4d6526ece2f476 Mon Sep 17 00:00:00 2001 From: Aravind Karnam Date: Thu, 3 Apr 2025 17:42:51 +0530 Subject: [PATCH] chore: move from faust-cchardet to chardet --- crawl4ai/async_crawler_strategy.py | 4 ++-- pyproject.toml | 2 +- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crawl4ai/async_crawler_strategy.py b/crawl4ai/async_crawler_strategy.py index f18a3c1..301d925 100644 --- a/crawl4ai/async_crawler_strategy.py +++ b/crawl4ai/async_crawler_strategy.py @@ -24,7 +24,7 @@ from .browser_manager import BrowserManager import aiofiles import aiohttp -import cchardet +import chardet from aiohttp.client import ClientTimeout from urllib.parse import urlparse from types import MappingProxyType @@ -1822,7 +1822,7 @@ class AsyncHTTPCrawlerStrategy(AsyncCrawlerStrategy): encoding = response.charset if not encoding: - encoding = cchardet.detect(content.tobytes())['encoding'] or 'utf-8' + encoding = chardet.detect(content.tobytes())['encoding'] or 'utf-8' result = AsyncCrawlResponse( html=content.tobytes().decode(encoding, errors='replace'), diff --git a/pyproject.toml b/pyproject.toml index 247974c..032e5cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "fake-useragent>=2.0.3", "click>=8.1.7", "pyperclip>=1.8.2", - "faust-cchardet>=2.1.19", + "chardet>=5.2.0", "aiohttp>=3.11.11", "brotli>=1.1.0", "humanize>=4.10.0", diff --git a/requirements.txt b/requirements.txt index 5fe0cc4..0bb596d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,5 +21,5 @@ psutil>=6.1.1 nltk>=3.9.1 rich>=13.9.4 cssselect>=1.2.0 -faust-cchardet>=2.1.19 +chardet>=5.2.0 brotli>=1.1.0 \ No newline at end of file