abhishekjnvk / telegram-channel-downloader

Open Source Node.js script that simplifies scraping media files and messages from Telegram channels, groups, or users, facilitating offline access and storage of images, videos, and documents
106 stars 22 forks source link

Keep getting timeout on files #11

Open lesleyxyz opened 6 months ago

lesleyxyz commented 6 months ago

The files are 500MB each and rar archives. When the timeout occurs, the download for that file stops but the other files continue. After a while eventually all files time out.

It must be noted that I do not have the issue with this downloader: https://github.com/Dineshkarthik/telegram_media_downloader

I assume it's because this file tries to download 5 files at once, while the other downloader only does 1 at a time?

Logs:

lesley@docker:/mnt/zfs/repos/telegram-channel-downloader$ npm start

> telegram-channel-downloader@1.0.0 start
> node index.js

[2024-06-04T13:59:50.276] [INFO] - [Running gramJS version 2.21.1]
[2024-06-04T13:59:50.282] [INFO] - [Connecting to 149.154.167.91:80/TCPFull...]
[2024-06-04T13:59:50.311] [INFO] - [Connection to 149.154.167.91:80/TCPFull complete!]
[2024-06-04T13:59:50.312] [INFO] - [Using LAYER 179 for initial connect]
✅  You should now be connected. 
✅  Selected channel is: <redacted> 
? Do you want to change channel? No
? Choose file to download custom
? Enter file extension separated by comma:  rar
📢:  getting messages (100/2951) : 3% 
[2024-06-04T14:00:01.323] [INFO] - [Starting direct file download in chunks of 262144 at 0, stride 262144]
[2024-06-04T14:00:01.324] [INFO] - [Starting direct file download in chunks of 262144 at 0, stride 262144]
[2024-06-04T14:00:01.324] [INFO] - [Starting direct file download in chunks of 262144 at 0, stride 262144]
[2024-06-04T14:00:01.324] [INFO] - [Starting direct file download in chunks of 262144 at 0, stride 262144]
[2024-06-04T14:00:01.325] [INFO] - [Starting direct file download in chunks of 262144 at 0, stride 262144]
📢:  Waiting for files to be downloaded (5 at a time) 
[2024-06-04T14:00:01.384] [INFO] - [Connecting to 149.154.167.91:443/TCPFull...]
[2024-06-04T14:00:01.414] [INFO] - [Connection to 149.154.167.91:443/TCPFull complete!]
[2024-06-04T14:00:01.496] [INFO] - [File lives in another DC]
[2024-06-04T14:00:01.497] [INFO] - [Connecting to 149.154.175.51:443/TCPFull...]
[2024-06-04T14:00:01.500] [INFO] - [File lives in another DC]
[2024-06-04T14:00:01.503] [INFO] - [File lives in another DC]
[2024-06-04T14:00:01.515] [INFO] - [File lives in another DC]
[2024-06-04T14:00:01.517] [INFO] - [File lives in another DC]
[2024-06-04T14:00:03.413] [INFO] - [Connection to 149.154.175.51:443/TCPFull complete!]
[2024-06-04T14:00:03.414] [INFO] - [Exporting authorization for data center 149.154.175.51 with layer 179]
[2024-06-04T14:00:31.414] [WARN] - [Disconnecting...]
[2024-06-04T14:00:31.415] [INFO] - [Disconnecting from 149.154.167.91:443/TCPFull...]
[2024-06-04T14:00:31.416] [INFO] - [connection closed]
❌  Error in downloadMessageMedia() 
RPCError: -503: Timedout (caused by upload.GetFile)
    at RPCMessageToError (/mnt/zfs/repos/telegram-channel-downloader/node_modules/telegram/errors/index.js:28:12)
    at MTProtoSender._handleRPCResult (/mnt/zfs/repos/telegram-channel-downloader/node_modules/telegram/network/MTProtoSender.js:546:58)
    at MTProtoSender._processMessage (/mnt/zfs/repos/telegram-channel-downloader/node_modules/telegram/network/MTProtoSender.js:476:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MTProtoSender._recvLoop (/mnt/zfs/repos/telegram-channel-downloader/node_modules/telegram/network/MTProtoSender.js:424:17) {
  code: -503,
  errorMessage: 'Timedout'
}

lesley@docker:/mnt/zfs/repos/telegram_media_downloader/document$ node -v
v20.5.0
lesley@docker:/mnt/zfs/repos/telegram_media_downloader/document$ npm -v
9.8.0
MinhHhoang commented 4 months ago

Do you have a solution for this case yet? . you can share it with me. thanks

lesleyxyz commented 4 months ago

Unfortunately not for this project. However I've been using this project instead and it's been perfect: https://github.com/iyear/tdl