2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Add new sessions to the media_sessions dict before starting them

This commit is contained in:
Dan 2018-05-01 20:25:35 +02:00
parent db14aa288d
commit 1b48f850bf

View File

@ -2992,6 +2992,8 @@ class Client:
self.api_id
)
self.media_sessions[dc_id] = session
session.start()
session.send(
@ -3009,10 +3011,10 @@ class Client:
self.api_id
)
session.start()
self.media_sessions[dc_id] = session
session.start()
if volume_id: # Photos are accessed by volume_id, local_id, secret
location = types.InputFileLocation(
volume_id=volume_id,
@ -3080,10 +3082,10 @@ class Client:
is_cdn=True
)
cdn_session.start()
self.media_sessions[r.dc_id] = cdn_session
cdn_session.start()
try:
with tempfile.NamedTemporaryFile("wb", delete=False) as f:
file_name = f.name