Skip to content

Downloading multiple file causes error #252

Open

Description

@prisonerr627
edout (caused by GetFileRequest)                                                                                                    
Telegram is having internal issues TimedOutError: RPCError -503: Timedout (caused by GetFileRequest)                                                                                                                                                                                                                                                                                                                                
Traceback (most recent call last):                                                                                                  
  File "/root/.local/bin/telegram-download", line 8, in <module>                                                                    
    sys.exit(download_cli())                                                                                                        
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/exceptions.py", line 68, in wrap                                                                                                                                      
    return fn(*args, **kwargs)                                                                                                      
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/click/core.py", line 1157, in __call__                                                                                                                                                
    return self.main(*args, **kwargs)                                                                                               
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/click/core.py", line 1078, in main                                                                                                                                                    
    rv = self.invoke(ctx)                                                                                                           
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/click/core.py", line 1434, in invoke                                                                                                                                                  
    return ctx.invoke(self.callback, **ctx.params)                                                                                  
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/click/core.py", line 783, in invoke                                                                                                                                                   
    return __callback(*args, **kwargs)                                                                                              
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/management.py", line 231, in download                                                                                                                                 
    client.download_files(from_, download_files, delete_on_success)                                                                 
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/client/telegram_download_client.py", line 52, in download_files                                                                                                       
    file_name = self.download_media(download_file.message, progress_callback=progress)                                              
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/sync.py", line 39, in syncified                                                                                                                                              
    return loop.run_until_complete(coro)                                                                                            
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete                                                 
    return future.result()                                                                                                          
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/client/downloads.py", line 422, in download_media                                                                                                                            
    return await self._download_document(                                                                                           
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/client/downloads.py", line 895, in _download_document                                                                                                                        
    result = await self._download_file(                                                                                             
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/client/telegram_download_client.py", line 104, in _download_file                                                                                                      
    chunk = b''.join(filter(bool, [task.result() for task in tasks]))                                                               
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/client/telegram_download_client.py", line 104, in <listcomp>                                                                                                          
    chunk = b''.join(filter(bool, [task.result() for task in tasks]))                                                               
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/_compat.py", line 63, in anext                                                                                                                                        
    return await iterator.__anext__()                                                                                               
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/requestiter.py", line 74, in __anext__                                                                                                                                       
    if await self._load_next_chunk():                                                                                               
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/client/downloads.py", line 66, in _load_next_chunk                                                                                                                           
    cur = await self._request()                                                                                                     
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/client/downloads.py", line 76, in _request                                                                                                                                   
    result = await self.client._call(self._sender, self.request)                                                                    
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telethon/client/users.py", line 87, in _call                                                                                                                                          
    result = await future                                                                                                           
telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest)                                                                   
Task exception was never retrieved                                                                                                  
future: <Task finished name='Task-20368' coro=<anext() done, defined at /root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/_compat.py:14> exception=FileReferenceExpiredError('The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest)')>                                                                                                                                                                          
Traceback (most recent call last):                                                                                                  
  File "/root/.local/share/pipx/venvs/telegram-upload/lib/python3.9/site-packages/telegram_upload/_compat.py", line 63, in anext                                                                                                                                        
    return await iterator.__anext__()                                                                                               ```

Activity

  1. prisonerr627 commented on Mar 23, 2024

    @prisonerr627
    Author

    after the error it just gets stuck
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions