Upload #
Upload Files #
Upload specified files and directories to Saved Messages:
tdl up -p /path/to/file -p /path/to/dir
Custom Destination #
Upload to custom chat.
CHAT Examples
tdl up -p /path/to/file -c CHAT
Custom Parameters #
Upload with 8 threads per task, 4 concurrent tasks:
tdl up -p /path/to/file -t 8 -l 4
Custom Caption #
Custom caption is based on expression.
List all available fields:
tdl up -p ./downloads --caption -
Custom simple caption:
tdl up -p ./downloads --caption 'File.Name + " - uploaded by tdl"'
Write styled message with HTML:
tdl up -p ./downloads --caption \'FileName + `<b>Bold</b> <a href="https://example.com">Link</a>`'
Pass a file name if the expression is complex:
caption.txt
repeat(FileName, 2) + `
<a href="https://www.google.com">Google</a>
<a href="https://www.bing.com">Bing</a>
<b>bold</b>
<i>italic</i>
<code>code</code>
<tg-spoiler>spoiler</tg-spoiler>
<pre><code class="language-go">
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
</code></pre>
` + MIME
tdl up -p ./downloads --caption caption.txt
Filter #
Upload files except specified extensions:
tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
Filters #
Upload files with extension filters:
The extension is only matched with the file name, not the MIME type. So it may not work as expected.
Whitelist and blacklist can not be used at the same time.
Whitelist: Only upload files with .jpg .png extension
tdl up -p /path/to/file -p /path/to/dir -i jpg,png
Blacklist: Upload all files except .mp4 .flv extension
tdl up -p /path/to/file -p /path/to/dir -e mp4 -e flv
Delete Local #
Delete the uploaded file after uploading successfully:
tdl up -p /path/to/file --rm
Photo #
Upload images as photos instead of documents:
tdl up -p /path/to/file --photo