Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(template): add MaxLength argument to filenamify method #914

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LuRenJiasWorld
Copy link

@LuRenJiasWorld LuRenJiasWorld commented Mar 26, 2025

When using {{ .FileCaption }} in filename templates, some long caption would cause download failure due to file system length limit.

So I add a second optional argument to filenamify method, to limit string length to a value that would not exceed the limit.

Usage:

tdl dl -f ./tdl-export.json --pool 16 -t 4 -l 1 --delay 3s --skip-same --template '{{ .MessageDate }}_{{ filenamify .FileCaption 128 }}_{{ .MessageID }}_{{ .FileName }}'

Since this is my first time contributing to this project, I’d appreciate your direct feedback if any adjustments are needed in my changes!

@LuRenJiasWorld LuRenJiasWorld requested a review from iyear as a code owner March 26, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant