@@ -1212,7 +1212,7 @@ def download_worker(self):
12121212 final_file_path = ""
12131213
12141214 try :
1215- data , directory , file_name , done , progress , progress_args , path = packet
1215+ data , directory , file_name , done , progress , progress_args , path , file_reference = packet
12161216
12171217 temp_file_path = self .get_file (
12181218 media_type = data .media_type ,
@@ -1225,6 +1225,7 @@ def download_worker(self):
12251225 volume_id = data .volume_id ,
12261226 local_id = data .local_id ,
12271227 file_size = data .file_size ,
1228+ file_reference = file_reference ,
12281229 is_big = data .is_big ,
12291230 progress = progress ,
12301231 progress_args = progress_args
@@ -1871,7 +1872,8 @@ def get_file(
18711872 file_size : int ,
18721873 is_big : bool ,
18731874 progress : callable ,
1874- progress_args : tuple = ()
1875+ progress_args : tuple = (),
1876+ file_reference : bytes = b""
18751877 ) -> str :
18761878 with self .media_sessions_lock :
18771879 session = self .media_sessions .get (dc_id , None )
@@ -1922,21 +1924,21 @@ def get_file(
19221924 location = types .InputPhotoFileLocation (
19231925 id = document_id ,
19241926 access_hash = access_hash ,
1925- file_reference = b"" ,
1927+ file_reference = file_reference ,
19261928 thumb_size = thumb_size
19271929 )
19281930 elif media_type == 14 :
19291931 location = types .InputDocumentFileLocation (
19301932 id = document_id ,
19311933 access_hash = access_hash ,
1932- file_reference = b"" ,
1934+ file_reference = file_reference ,
19331935 thumb_size = thumb_size
19341936 )
19351937 else :
19361938 location = types .InputDocumentFileLocation (
19371939 id = document_id ,
19381940 access_hash = access_hash ,
1939- file_reference = b"" ,
1941+ file_reference = file_reference ,
19401942 thumb_size = ""
19411943 )
19421944
0 commit comments