2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Fix PhotoSize not having date anymore

This commit is contained in:
Dan 2018-07-01 19:43:29 +02:00
parent 6943e16636
commit c660d3a7d0

View File

@ -711,7 +711,9 @@ class Client(Methods, BaseClient):
file_name = "{}_{}_{}{}".format(
media_type_str,
datetime.fromtimestamp(media.date or time.time()).strftime("%Y-%m-%d_%H-%M-%S"),
datetime.fromtimestamp(
getattr(media, "date", None) or time.time()
).strftime("%Y-%m-%d_%H-%M-%S"),
self.rnd_id(),
extension
)