-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
--trim-filenames fails to clip file name properly when there is a dot in a video title #2314
Comments
I am aware of this issue 😓. The --trim-filename option is just overall poorly implemented, making this tricky to fix. I honestly suggest using something like |
Related: #1837 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@JoakimCh Yes, and the answer is even pinned! #1136 (comment) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I suggest you read the discussion under the linked comment. This issue is about the bug in For reference, here's a potential solution for the actual issue #5526 (comment) |
Checklist
Description
This procedure:
yt-dlp/yt_dlp/YoutubeDL.py
Lines 1221 to 1225 in e04938a
Assumes that there is at most 2 extensions appended to the current filename. This fails when there is a dot in a video title. Yeah, that happens.
Proposed fixes
a. assuming there is only one extension => using
os.path.splitext()
to split the filename before trimmingb. trimming the file name before appending the ext.
foo-bar-foo.mp4
to 14 chars would producefoo-bar-foo.mp.mp4
)c. mask dots from extracted video titles
d. let me know if you have some other idea
I am happy to fix that, just let me know which (a-d) would the maintainers prefer.
Verbose log
The text was updated successfully, but these errors were encountered: