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

[Feature Request] Limit filename to # of bytes (not characters) #1003

Closed
3 tasks done
TowardMyth opened this issue Sep 17, 2021 · 2 comments
Closed
3 tasks done

[Feature Request] Limit filename to # of bytes (not characters) #1003

TowardMyth opened this issue Sep 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@TowardMyth
Copy link

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running yt-dlp version 2021.09.02
  • I've searched the bugtracker for similar feature requests including closed ones

Description

YT-DLP has a feature to limit the filename length to some number of characters.

Is it possible to limit the filename length to some number of bytes and not characters too? Non-Latin languages require more than 1 byte to represent a character. For example, Japanese/Korean/Chinese characters require 3 bytes per character.

Use case: for example, EXT4 file systems only allow 255 byte file name limits.

Thank you!

@pukkandan pukkandan added the enhancement New feature or request label Sep 17, 2021
@pukkandan pukkandan self-assigned this Sep 17, 2021
@pukkandan
Copy link
Member

With f5aa5cf, you can do %(title).200B to limit to 200 bytes instead of %(title).200s which normally limits to 200 chars

@TowardMyth
Copy link
Author

thanks for the quick implementation!

nixxo pushed a commit to nixxo/yt-dlp that referenced this issue Nov 22, 2021
This is useful to limit the filename to a certain number of bytes rather than characters
Closes yt-dlp#1003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants