@@ -396,6 +396,12 @@ tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
396396tdl up -p /path/to/file -t 8 -s 524288 -l 4
397397```
398398
399+ - Delete the uploaded file after successful upload:
400+
401+ ``` shell
402+ tdl up -p /path/to/file --rm
403+ ```
404+
399405- Upload to custom chat:
400406
401407``` shell
@@ -439,37 +445,62 @@ tdl recover -f /path/to/backup.zip
439445
440446``` shell
441447tdl chat ls
448+
449+ # output with JSON format
450+ tdl chat ls -o json
451+
452+ # specify filter that powered by expression engine, default is `true`(match all)
453+ # feel free to file an issue if you have any questions about the expression engine.
454+ # expression engine docs: https://expr.medv.io/docs/Language-Definition
455+
456+ # list all available filter fields
457+ tdl chat ls -f -
458+ # list channels that VisibleName contains "Telegram"
459+ tdl chat ls -f " Type contains 'channel' && VisibleName contains 'Telegram'"
460+ # list groups that have topics
461+ tdl chat ls -f " len(Topics)>0"
442462```
443463
444- - Export minimal JSON for ` tdl ` download (NOT for backup) :
464+ - Export JSON for ` tdl ` download:
445465
446466``` shell
447467# will export all media files in the chat.
448468# chat input examples: `@iyear`, `iyear`, `123456789`(chat id), `https://t.me/iyear`, `+1 123456789`
449469
450- # export all messages
470+ # export all media messages
451471tdl chat export -c CHAT_INPUT
452472
473+ # export all messages including non-media messages
474+ tdl chat export -c CHAT_INPUT --all
475+
476+ # export Telegram MTProto raw message structure, useful for debugging
477+ tdl chat export -c CHAT_INPUT --raw
478+
479+ # export from specific topic
480+ # You can get topic id from:
481+ # 1. message link: https://t.me/c/1492447836/251011/269724(251011 is topic id)
482+ # 2. `tdl chat ls` command
483+ tdl chat export -c CHAT_INPUT --topic TOPIC_ID
484+ # export from specific channel post replies
485+ tdl chat export -c CHAT_INPUT --reply MSG_ID
486+
453487# export with specific timestamp range, default is start from 1970-01-01, end to now
454488tdl chat export -c CHAT_INPUT -i 1665700000,1665761624
455489# or (time is default type)
456490tdl chat export -c CHAT_INPUT -T time -i 1665700000,1665761624
457-
458491# export with specific message id range, default to start from 0, end to latest message
459492tdl chat export -c CHAT_INPUT -T id -i 100,500
460-
461493# export last N media files
462494tdl chat export -c CHAT_INPUT -T last -i 100
463495
464- # specify files filter that powered by regexp, default matches all files
465- # regexp syntax: https://github.com/google/re2/wiki/Syntax
466- # supported fields: `file`, `content`
467- tdl chat export -c CHAT_INPUT -f file=.* \. jpg # match file name ends with `.jpg`
468- tdl chat export -c CHAT_INPUT -f content=.* Book.* # match message content contains `Book`
469- tdl chat export -c CHAT_INPUT -f file=.* \. jpg,content=.* Book.* # match both
496+ # specify filter that powered by expression engine, default is `true`(match all)
497+ # feel free to file an issue if you have any questions about the expression engine.
498+ # expression engine docs: https://expr.medv.io/docs/Language-Definition
470499
471- # practice: export a specific message from protected chat
472- tdl chat export -c CHAT_INPUT -i 1 -T last -f file=FILE_NAME_REGEXP,content=MESSAGE_CONTENT_REGEXP
500+ # list all available filter fields
501+ tdl chat export -c CHAT_INPUT -f -
502+ # match last 10 zip files that size > 5MiB and views > 200
503+ tdl chat export -c CHAT_INPUT -T last -i 10 -f " Views>200 && Media.Name endsWith '.zip' && Media.Size > 5*1024*1024"
473504
474505# specify the output file path, default is `tdl-export.json`
475506tdl chat export -c CHAT_INPUT -o /path/to/output.json
0 commit comments