Skip to content

Commit 3be32ed

Browse files
committed
docs(README): v0.9.0
1 parent a301e1c commit 3be32ed

2 files changed

Lines changed: 87 additions & 24 deletions

File tree

README.md

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
396396
tdl 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
441447
tdl 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
451471
tdl 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
454488
tdl chat export -c CHAT_INPUT -i 1665700000,1665761624
455489
# or (time is default type)
456490
tdl 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
459492
tdl chat export -c CHAT_INPUT -T id -i 100,500
460-
461493
# export last N media files
462494
tdl 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`
475506
tdl chat export -c CHAT_INPUT -o /path/to/output.json

README_zh.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,12 @@ tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
402402
tdl up -p /path/to/file -t 8 -s 524288 -l 4
403403
```
404404

405+
- 删除本地已上传成功的文件:
406+
407+
```shell
408+
tdl up -p /path/to/file --rm
409+
```
410+
405411
- 上传文件到自定义会话:
406412

407413
```shell
@@ -446,37 +452,63 @@ tdl recover -f /path/to/backup.zip
446452

447453
```shell
448454
tdl chat ls
455+
456+
# 输出为 JSON 格式
457+
tdl chat ls -o json
458+
459+
# 指定使用表达式引擎的过滤器,默认值为 `true`(匹配所有)
460+
# 如果你对表达式引擎有任何问题,请发起新的 ISSUE
461+
# 表达式引擎文档: https://expr.medv.io/docs/Language-Definition
462+
463+
# 列出所有可用的过滤器字段
464+
tdl chat ls -f -
465+
# 列出所有名称包含 "Telegram" 的频道
466+
tdl chat ls -f "Type contains 'channel' && VisibleName contains 'Telegram'"
467+
# 列出所有设置了话题功能的群组
468+
tdl chat ls -f "len(Topics)>0"
449469
```
450470

451-
- 导出最小化的 JSON 文件,用于 `tdl` 下载(非备份作用)
471+
- 导出 JSON 文件,可用于 `tdl` 下载
452472

453473
```shell
454474
# 将导出会话中的所有媒体文件
455475
# CHAT_INPUT 可接受例子: `@iyear`, `iyear`, `123456789`(会话 ID), `https://t.me/iyear`, `+1 123456789`
456476

457-
# 导出所有消息
477+
# 导出所有含媒体文件的消息
458478
tdl chat export -c CHAT_INPUT
459479

480+
# 导出包含非媒体文件的所有消息
481+
tdl chat export -c CHAT_INPUT --all
482+
483+
# 导出 Telegram MTProto 原生消息结构,可用于调试
484+
tdl chat export -c CHAT_INPUT --raw
485+
486+
# 从指定 Topic 导出
487+
# 你可以从以下方式获取 topic id:
488+
# 1. 消息链接: https://t.me/c/1492447836/251011/269724(251011 为 topic id)
489+
# 2. `tdl chat ls` 命令
490+
tdl chat export -c CHAT_INPUT --topic TOPIC_ID
491+
492+
# 从指定频道文章的讨论区导出
493+
tdl chat export -c CHAT_INPUT --reply MSG_ID
494+
460495
# 导出指定时间范围内的消息
461496
tdl chat export -c CHAT_INPUT -i 1665700000,1665761624
462497
#
463498
tdl chat export -c CHAT_INPUT -T time -i 1665700000,1665761624
464-
465499
# 导出指定消息 ID 范围内的消息
466500
tdl chat export -c CHAT_INPUT -T id -i 100,500
467-
468501
# 导出最近 N 条消息(计数受过滤器影响)
469502
tdl chat export -c CHAT_INPUT -T last -i 100
470503

471-
# 指定文件过滤器,使用正则表达式,默认为匹配所有文件
472-
# 正则表达式语法: https://github.com/google/re2/wiki/Syntax
473-
# 支持过滤字段: `file`, `content`
474-
tdl chat export -c CHAT_INPUT -f file=.*\.jpg # 匹配文件扩展名为 `.jpg` 的消息
475-
tdl chat export -c CHAT_INPUT -f content=.*Book.* # 匹配消息内容中包含 `Book` 的消息
476-
tdl chat export -c CHAT_INPUT -f file=.*\.jpg,content=.*Book.* # 同时使用多个过滤器
504+
# 使用由表达式引擎提供的过滤器,默认为 `true`(即匹配所有)
505+
# 如果你对表达式引擎有任何问题,请发起新的 ISSUE
506+
# 表达式引擎文档: https://expr.medv.io/docs/Language-Definition
477507

478-
# 例子:从会话中导出指定的某条消息
479-
tdl chat export -c CHAT_INPUT -i 1 -T last -f file=FILE_NAME_REGEXP,content=MESSAGE_CONTENT_REGEXP
508+
# 列出所有可用的过滤器字段
509+
tdl chat export -c CHAT_INPUT -f -
510+
# 匹配所有 zip 文件,大小 > 5MiB,且消息浏览量 > 200 的最近 10 条消息
511+
tdl chat export -c CHAT_INPUT -T last -i 10 -f "Views>200 && Media.Name endsWith '.zip' && Media.Size > 5*1024*1024"
480512

481513
# 指定输出文件路径,默认为 `tdl-export.json`
482514
tdl chat export -c CHAT_INPUT -o /path/to/output.json

0 commit comments

Comments
 (0)