-"""Robot based on curl-cffi
+"""Robot based on curl-cffi.request.Session()
This file is a part of Bookmarks database and Internet robot.
__all__ = ['robot_curlcffi']
-from curl_cffi import requests
+from curl_cffi.requests import Session
import curl_cffi
from Robots.base import robot_base
error = r = None
try:
- r = requests.get(url, headers=req_headers,
- timeout=self.timeout,
- allow_redirects=False, proxies=proxies,
- verify=False, impersonate='firefox133')
+ with Session() as s:
+ r = s.get(url, headers=req_headers,
+ timeout=self.timeout,
+ allow_redirects=False, proxies=proxies,
+ verify=False, impersonate='firefox133')
except curl_cffi.CurlError as e:
error = str(e)
return error, None, None, None