screenshot fixesxy

pull/489/head
dgtlmoon 3 years ago
parent 703922c369
commit 5f3251a3e1

@ -45,10 +45,6 @@ class Fetcher():
def quit(self): def quit(self):
return return
@abstractmethod
def screenshot(self):
return
@abstractmethod @abstractmethod
def get_last_status_code(self): def get_last_status_code(self):
return self.status_code return self.status_code
@ -149,7 +145,7 @@ class base_html_playwright(Fetcher):
# Some bug where it gives the wrong screenshot size, but making a request with the clip set first seems to solve it # Some bug where it gives the wrong screenshot size, but making a request with the clip set first seems to solve it
# JPEG is better here because the screenshots can be very very large # JPEG is better here because the screenshots can be very very large
screenshot = page.screenshot(type='jpeg', clip={'x': 1.0, 'y': 1.0, 'width': 1280, 'height': 1024}) page.screenshot(type='jpeg', clip={'x': 1.0, 'y': 1.0, 'width': 1280, 'height': 1024})
self.screenshot = page.screenshot(type='jpeg', full_page=True, quality=90) self.screenshot = page.screenshot(type='jpeg', full_page=True, quality=90)
context.close() context.close()
browser.close() browser.close()

@ -142,7 +142,7 @@ class update_worker(threading.Thread):
self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3), self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3),
'last_checked': round(time.time())}) 'last_checked': round(time.time())})
# Always save the screenshot if it's available # Always save the screenshot if it's available
if screenshot is not None: if screenshot:
self.datastore.save_screenshot(watch_uuid=uuid, screenshot=screenshot) self.datastore.save_screenshot(watch_uuid=uuid, screenshot=screenshot)
self.current_uuid = None # Done self.current_uuid = None # Done

Loading…
Cancel
Save