Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] download all files from a thread/discussion/comments #655

Open
papaj-na-wrotkach opened this issue Jun 19, 2024 · 4 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@papaj-na-wrotkach
Copy link

papaj-na-wrotkach commented Jun 19, 2024

Proposal

Does/can TDL support downloading all files from the comments section of a channel message? I tried using urls like https://t.me/c/{channel}/{thread} https://t.me/c/{channel}/?thread={thread} but only the first one worked - it downloaded the file from the message in the channel, not all messages from the comments of that message (from the discussion chat).

Also, please correct me if I am wrong. As I understand it, thread is the term for the message in the channel with all it's replies (visible as comments) in the discussion chat. Thread ID is just the ID of the message that started it (message from the channel forwarded to discussion chat).

Background

I use a (private) channel to post some files - large archives split into 2000 MiB parts (2000 MiB is the file size limit for free accounts). This channel supports comments. I group all parts of an archive by posting them as comments to the message with the name and description of the archive. I want to be able to download all parts with one command.

Workarounds

Export messages with tdl chat export and filter them by name using -f flag (Media.Name contains or sth).

edit: There's also --topic option for tdl chat export. but I am wondering if there's an url format or some other way to do it.

@papaj-na-wrotkach papaj-na-wrotkach added the enhancement New feature or request label Jun 19, 2024
@erosaishen
Copy link

I also request to add this feature

@iyear
Copy link
Owner

iyear commented Sep 17, 2024

You have two options:

  1. Use a link like https://t.me/XXX/13511?comment=686891 and pass it as the -u flag. This allows you to download a specific channel post comment.
  2. Use tdl chat export --reply POST_ID to export the comments of the channel post. Then use tdl dl -f export_reply.json for batch downloading."

@o2e
Copy link

o2e commented Sep 18, 2024

You have two options:

  1. Use a link like https://t.me/XXX/13511?comment=686891 and pass it as the -u flag. This allows you to download a specific channel post comment.
  2. Use tdl chat export --reply POST_ID to export the comments of the channel post. Then use tdl dl -f export_reply.json for batch downloading."

@iyear This is a solution for when a small amount of content is downloaded. When I add a new channel that has thousands of messages and the messages all contain attachments in the form of replies/comments in a packet/split-volume zip, this is very cumbersome and it's easy to miss the target, which is disastrous for small hamsters. I would like to see in the option to export all messages, add a command to export the message's corresponding comments and expand the message serial number or customize a serial number to make it easier to find the corresponding file after downloading, e.g. if the post's messagesid=1111, then the comment's replyid could be replyid=1111-1, or use a similar approach to handle message consistency. What do you think?

@izaac
Copy link

izaac commented Oct 30, 2024

It's not perfect but I did this to at least get them sequentially, after an export:

for i in $(cat tdl-export-nojpg.json | grep '"id"' | awk '/id/ { if(NR>1) print $2 }' | sed 's/,//'); do url="https://t.me/c/XXXXXXXXXX/2/${i}"; echo ${url}; tdl dl -u ${url}; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants