Filter options when download from json file
As i understand correctly filters (-f) are aplicable to extra telegram messages to json files.
Is there a way to extract only the messages (or media) that contain a part of the media filename?
Or is there an other way to filter more specific on media names? I have seen you can filter on the extension (Media.Name), but the string don`t work on the part before the extension.
I'm not entirely sure about your requirement. Could you please provide an example command that meets your needs?
But based on your description, I believe your mentioned need for filtering by the complete filename during download should be achievable through the expr feature(aka Filter Guide) mentioned on the https://docs.iyear.me/tdl/guide/tools/export-messages/#filter page.
For instance, if you want to download all the file that file name contains "Haachama", you can use tdl chat export -c CHAT -f "Media.Name contains 'Haachama'" while exporting.
And if you want to check all the available params, I paste them here.
❯ tdl chat export -c CHAT -f -
Mentioned: bool # Whether we were mentioned in this message
Silent: bool # Whether this is a silent message (no notification triggered)
FromScheduled: bool # Whether this is a scheduled message
Pinned: bool # Whether this message is pinned
ID: int # ID of the message
FromID: int64 # ID of the sender of the message
Date: int # Date of the message
Message: string # The message
Media.Name: string # File name
Media.Size: int64 # File size. Unit: Byte
Media.DC: int # DC ID
Views: int # View count
Forwards: int # Forward count
How can I download content for a specific period of time? For example, how can I download content from the 11th to the 15th (since I've already downloaded previous videos)?
Could you please provide an example command?Thank you so much.
How can I download content for a specific period of time? For example, how can I download content from the 11th to the 15th (since I've already downloaded previous videos)?
Could you please provide an example command?Thank you so much.
TDL has serval ways to achieve your requirements. You can use tdl export export messages first and then download them. Here is an example, I cannot guarantee that the code will run, but the general usage is correct.
If you want to download from 11/10/2025 - 15/10/2025 from a group/channel which id is CHAT
-
tdl chat export -c CHAT -T time -I 1760140800,1760572800 -o example.jsonwhile 1760140800 is the timestamp of 11/10/2025 00:00 and 1760572800 is the timestamp of 16/10/2025 00:00. -
tdl dl -f example.json
For further explanation check https://docs.iyear.me/tdl/guide/tools/export-messages/#custom-type
How can I download content for a specific period of time? For example, how can I download content from the 11th to the 15th (since I've already downloaded previous videos)? Could you please provide an example command?Thank you so much.
TDL has serval ways to achieve your requirements. You can use
tdl exportexport messages first and then download them. Here is an example, I cannot guarantee that the code will run, but the general usage is correct.If you want to download from 11/10/2025 - 15/10/2025 from a group/channel which id is
CHAT
tdl chat export -c CHAT -T time -I 1760140800,1760572800 -o example.jsonwhile 1760140800 is the timestamp of 11/10/2025 00:00 and 1760572800 is the timestamp of 16/10/2025 00:00.tdl dl -f example.jsonFor further explanation check https://docs.iyear.me/tdl/guide/tools/export-messages/#custom-type
Thank you . And I have another question. Does the "tdl export" exported message contain text or just video? And where can I find the exported JSON file?
@PlutoLuna
Does the "tdl export" exported message contain text or just video?
Please read https://docs.iyear.me/tdl/guide/tools/export-messages/#non-media and https://docs.iyear.me/tdl/guide/tools/export-messages/#non-media carefully. It's clearly explained in this document, and I believe you can understand it.
And where can I find the exported JSON file?
Check https://docs.iyear.me/tdl/guide/tools/export-messages/#custom-destination. The exported JSON files should be in the current directory of your terminal.
You can get your current dir via pwd command on linux and macOS, and echo %cd% on windows.