From 684aef3ded762805a04874cf4fd55a6ce757cfab Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 11 Jun 2019 21:12:00 +0200 Subject: [PATCH] Fix files downloaded with no file name --- pyrogram/client/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index fd5db423..1106a416 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -849,7 +849,9 @@ class Client(Methods, BaseClient): media_type_str = Client.MEDIA_TYPE_ID[data.media_type] - if not data.file_name: + file_name = file_name or data.file_name + + if not file_name: guessed_extension = self.guess_extension(data.mime_type) if data.media_type in (0, 1, 2, 14):