telegram-download-daemon icon indicating copy to clipboard operation
telegram-download-daemon copied to clipboard

Feature request: add a parameter to limit simultaneus downloads

Open Bazzu85 opened this issue 2 years ago • 10 comments

Hi, as title..

I'm trying the daemon and works well.. but 15 simultaneous files are too much... additionally I'm seeing very slow downloads compared with the client...

image

any tip?

Bazzu85 avatar Jan 01 '22 22:01 Bazzu85

try changing the line worker_count = multiprocessing.cpu_count() to worker_count = 2

alfem avatar Jan 03 '22 15:01 alfem

try changing the line worker_count = multiprocessing.cpu_count() to worker_count = 2

I found that line of code the next day and forgot to update the issue. Btw a parameter can be usefull, no?

About the slow download speed?

Bazzu85 avatar Jan 03 '22 15:01 Bazzu85

I found that line of code the next day and forgot to update the issue. Btw a parameter can be usefull, no?

Yes, I will add it in a close future.

About the slow download speed?

Telegram set limits to avoid congestion. When you try to download many files from one computer, Telegram make some 'magic' (or even drop some connections). Behind the curtains, the python-telethon library manages all this stuff. I will investigate if we can push those limits a bit.

alfem avatar Jan 03 '22 19:01 alfem

Mmh.. The slowiness happened when using the 2 worker_count to 2 and not downloading anything from the client..

Bazzu85 avatar Jan 03 '22 20:01 Bazzu85

try changing the line worker_count = multiprocessing.cpu_count() to worker_count = 2

How can you edit this inside a docker? I couldn't find a way

haudankaivajasi avatar Apr 04 '22 08:04 haudankaivajasi

How can you edit this inside a docker? I couldn't find a way

No, there is not an easy way to change this value, as it is not one of the script parameters.

Although you can change it if you use the script out of a container, if you want to do some testing.

alfem avatar Apr 04 '22 08:04 alfem

How can you edit this inside a docker? I couldn't find a way

No, there is not an easy way to change this value, as it is not one of the script parameters.

Although you can change it if you use the script out of a container, if you want to do some testing.

For some reason it is not able to mount the "telegram-download-daemon.py" file inside the container. I tried: "-v /path/to/file//telegram-download-daemon.py:/telegram-download-daemon.py " and this kind of mounting seems to be working in other containers

haudankaivajasi avatar Apr 04 '22 09:04 haudankaivajasi

I am not a docker expert, but I have read that if you mount a file (with -v) it must exists in the host machine, or it will be created as a directory.

alfem avatar Apr 04 '22 11:04 alfem

I am not a docker expert, but I have read that if you mount a file (with -v) it must exists in the host machine, or it will be created as a directory.

Yeah, the file is in the local directory but when I create the container it still creates a folder of that name. I'll try to see what is up with that

haudankaivajasi avatar Apr 04 '22 12:04 haudankaivajasi

I'm getting the idea that it is not possible to mount to the root folder and the files in it

haudankaivajasi avatar Apr 04 '22 17:04 haudankaivajasi