diff --git a/src/gemini_webapi/types/image.py b/src/gemini_webapi/types/image.py index 7c4cbc0..58196bd 100644 --- a/src/gemini_webapi/types/image.py +++ b/src/gemini_webapi/types/image.py @@ -136,7 +136,7 @@ def validate_cookies(cls, v: dict) -> dict: return v # @override - async def save(self, **kwargs) -> None: + async def save(self, **kwargs) -> str | None: """ Save the image to disk. @@ -147,8 +147,13 @@ async def save(self, **kwargs) -> None: And since the URL ends with a long hash, by default will use timestamp + end of the hash as the filename. kwargs: `dict`, optional Other arguments to pass to `Image.save`. + + Returns + ------- + `str | None` + Absolute path of the saved image if successfully saved. """ - await super().save( + return await super().save( filename=kwargs.pop("filename", None) or f"{datetime.now().strftime('%Y%m%d%H%M%S')}_{self.url[-10:]}.png", cookies=self.cookies,