tdl icon indicating copy to clipboard operation
tdl copied to clipboard

[Feat] Dynamically adding download links

Open huajideshutiao opened this issue 1 year ago • 3 comments

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.

huajideshutiao avatar May 30 '24 16:05 huajideshutiao

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

iyear avatar Jun 03 '24 15:06 iyear

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.

huajideshutiao avatar Jun 03 '24 16:06 huajideshutiao

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.

iyear avatar Jun 03 '24 16:06 iyear