返回提交历史
Modified
g4f/tools/web_search.py
+1
-1
XFEstudio/gpt4free
Fix: [Errno 36] File name too long
1b30651d
代码差异
1 个文件
+1
-1
@@ -112,7 +112,7 @@ async def fetch_and_scrape(session: ClientSession, url: str, max_words: int = No
112
112
bucket_dir: Path = Path(get_cookies_dir()) / ".scrape_cache" / "fetch_and_scrape"
113
113
bucket_dir.mkdir(parents=True, exist_ok=True)
114
114
md5_hash = hashlib.md5(url.encode()).hexdigest()
115
cache_file = bucket_dir / f"{url.split('?')[0].split('//')[1].replace('/', '+')}.{datetime.date.today()}.{md5_hash}.txt"
115
cache_file = bucket_dir / f"{url.split('?')[0].split('//')[1].replace('/', '+')[:16]}.{datetime.date.today()}.{md5_hash}.txt"
116
116
if cache_file.exists():
117
117
return cache_file.read_text()
118
118
async with session.get(url) as response: