iyear / tdl

📥 A Telegram toolkit written in Golang
https://docs.iyear.me/tdl
GNU Affero General Public License v3.0
4.45k stars 441 forks source link

[Feat] Name template from a json file #450

Closed smashkins closed 10 months ago

smashkins commented 10 months ago

Name template from json file.

tdl dl -f tdl-export.json --template "{{ .Filename }}-{{ .MessageDate }}"

Error callback:

Error: callback:
    github.com/gotd/td/telegram.(*Client).Run.func3
        github.com/gotd/td@v0.89.0/telegram/connect.go:151
  - iter:
    github.com/iyear/tdl/pkg/downloader.(*Downloader).Download
        github.com/iyear/tdl/pkg/downloader/downloader.go:59
  - execute template:
    github.com/iyear/tdl/app/dl.(*iter).process
        github.com/iyear/tdl/app/dl/iter.go:175
  - template: dl:1:3: executing "dl" at <.Filename>: can't evaluate field Filename in type *dl.fileTemplate
iyear commented 10 months ago

It's FileName not Filename