iyear / tdl

📥 A Telegram tookit written in Golang
https://docs.iyear.me/tdl
GNU Affero General Public License v3.0
3.77k stars 385 forks source link

[Feat] Dynamically adding download links #634

Open huajideshutiao opened 1 month ago

huajideshutiao commented 1 month ago

Proposal

I hope to use a certain parameter to add a new link to the download list when the program has already started downloading.

Background

This can facilitate some automated operations, such as using telegram bots for remote downloads.

Workarounds

None.

iyear commented 1 month ago

Would calling the tdl command each time when there is a new url solve the issue?

huajideshutiao commented 1 month ago

Would calling the tdl command each time when there is a new url solve the issue?

It should be possible. Additional information: I came up with this issue during a discussion on another project because

Discussion link

Currently the bot only supports single msg link in a message, if multiple messages containing msg link were received and started download at the same time, multiple tdl instance will be created, but tdl does not allow this. iyear/tdl#564

It may be possible in the future to support multiple msg link in a single message and pass the msg link to tdl, in this way only one instance of tdl will be created and will download them at the same time.

If there is currently a way to resolve this conflict (as I have been busy with certain things and have not used TDL for a while), then this issue should be closed.

iyear commented 1 month ago

Currently the bot only supports single msg link in a message, if multiple messages containing msg link were received and started download at the same time, multiple tdl instance will be created, but tdl does not allow this. https://github.com/iyear/tdl/issues/564

This is possible. You can achieve this using file storage. Reading and writing in JSON file format will not lock the file. Ref: https://docs.iyear.me/tdl/guide/global-config/#--storage

Note: Using the same session token across multiple instances is not recommended as it may lead to unexpected situations. However, you might give it a try.