-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Broken] Twitter: File name too long error #1280
Comments
|
Is it possible for yt-dlp to automatically truncate the output filename to fit into a safe-maximum character length ? For some sites (esp. Twitter), the default output filenames are too long (= length of entire tweet) most of the time, unless the user specifies otherwise using the
Regarding the output option & the config file, may I check what the correct config filename is for the portable Windows EXE binary (both I had previously tried the following filenames (as suggested at ReadMe.md), & placed the file beside the EXE in the same folder. But yt-dlp ignores all of them.
Config File Commands:# Shorten Video Filenames # Disable Filesystem Caching Or is there something wrong with the command ? I also tried: Tested on: Win 10 x64 |
I believe there is already a feature request open for this. Due to various reasons, actually implementing this is a bit hard, so custom config is the best solution for now
The name of the exe doesn't matter. The portable config file should be named |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've noticed that YT-DLP can't detect embedded Twitter vids in a News Article the same way it can YouTube Videos, and I suspect that may be related to this. Was going to make this a separate issue, but I didn't want to be redundant. |
Checklist
Verbose log
Description
when downloading videos from Twitter, yt-dlp fetches the Tweet text and creates a filename for the video out of it.
But if the tweet is long, the created filename becomes longer than the underlying file system accepts and yt-dlp aborts with an error message.
Workaround: give a shorter file name manually with the -o option, but this is cumbersome and requires manual interaction, and if not noticed in time, can lead to not having downloaded the video if the tweet has been deleted meanwhile.
Poor man's solution: Limit the full file name length to 255 byte.
Good solution:
perform an statfs for the target file system and determine the maximum file name length of the target directory.
See
man 2 statfs
Kernel/stdc-function to get a descriptor of the file system, including the maximum file name length.
This function also exists in Python, see
https://www.geeksforgeeks.org/python-os-statvfs-method/
os.statvfs(path)
The returned os.statvfs_result object has following attributes:
regards
The text was updated successfully, but these errors were encountered: