From 230ed709a0631c4bd539cf698e0172a260f3bafd Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 10 Jul 2024 20:46:08 -0400 Subject: prepare for reservations --- libraries/base.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libraries/base.py') diff --git a/libraries/base.py b/libraries/base.py index 74394be..f6f75e4 100644 --- a/libraries/base.py +++ b/libraries/base.py @@ -48,3 +48,10 @@ class BaseLibrary: """ This is where the login interaction should happen. """ + + def get_image(self, url): + """ Given the url, return the base64-encoded contents and image type as a tuple. """ + img_response = self.session.get(url) + img_b64 = base64.b64encode(img_response.content).decode() + img_type = img_response.headers["Content-Type"] + return img_b64, img_type -- cgit