diff --git a/crawl4ai/async_crawler_strategy.py b/crawl4ai/async_crawler_strategy.py index f18a3c1d..301d925f 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 247974c5..032e5cd6 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 5fe0cc4c..0bb596d1 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