1 """Robot based on requests
3 This file is a part of Bookmarks database and Internet robot.
7 __author__ = "Oleg Broytman <phd@phdru.name>"
8 __copyright__ = "Copyright (C) 2024 PhiloSoft Design"
9 __license__ = "GNU GPL"
11 __all__ = ['robot_requests']
17 from Robots.bkmk_robot_base import robot_base
19 requests_ftp.monkeypatch_session()
22 class robot_requests(robot_base):
23 def get(self, bookmark, url, accept_charset=False):
25 r = requests.Session().get(
26 url, timeout=self.timeout, allow_redirects=False)
27 except requests.RequestException as e:
29 self.log(' Error: %s' % error)
30 return error, None, None, None, None
33 return None, r.status_code, r.next.url, None, None
34 return None, None, None, r.headers, r.content
36 def get_ftp_welcome(self):
37 return '' # Alas, requests_ftp doesn't store welcome message