question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

«File name too long» should not error

See original GitHub issue

Checklist

  • I’m reporting a feature request
  • I’ve verified that I’m running youtube-dl version 2021.06.06
  • I’ve searched the bugtracker for similar feature requests including closed ones

Description

To reproduce:

  • try to download any video with a really long title
  • you get ERROR: unable to open for writing: [Errno 36] File name too long:
  • the video is not downloaded

My suggestion:

  • instead of an ERROR put a WARNING
  • download the video regardless, just truncate the title to an appropriate size, similar to what suggested in #29627

This will improve UX, check bug tracker to see how common this issue is.

#7765 talks about this too (with a linked pull request) but:

  • does not elaborate on whether it is actually a good thing / possible drawbacks
  • is limited to collaborators

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
pukkandancommented, Sep 21, 2022

--trim-filenames is a poorly implemented solution from youtube-dlc and I would not recommend porting it as-is. Even in yt-dlp, I recommend users to use the % formatting to control filename length instead. E.g. https://github.com/yt-dlp/yt-dlp/issues/3494

In the case of Twitter, id is NOT being truncated, which is a plus…

This is actually a bug and shows how poorly implemented the option is! See https://github.com/yt-dlp/yt-dlp/issues/2314. Do not rely on this behavior…

3reactions
galileo-pkmcommented, Nov 13, 2021

This is particularly annoying when downloading videos from Twitter as it takes the whole post as file name. I usually use --id and rename the file manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix 'Filename Is Too Long' Issue In Windows
It's obvious who the offender is in this case. Find the file in Windows Explorer, or File Explorer as it's called in Windows...
Read more >
SOLVED: The File Name Is Too Long
This error represents that the file name is either too long to open, delete, or edit considering the given file location or path...
Read more >
Fix Error 0x800700CE, The filename or extension is too long
It's very easy to fix the File name or extension is too long problem. You can try these solutions in the situation: run...
Read more >
Destination Path Too Long Error When Moving/Copying a File
The simplest way is to shorten the name of the parent folders, by reducing the total path length by simply renaming it. This...
Read more >
[SOLVED] How to Fix The File Name Too Long Error Problem
Since the File Name Too Long for destination folder windows 10 error is all about longer filename, so the first thing you need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found