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

[Errno 36] File name too long. -o templates don't support long names #813

Closed
Jimmm opened this issue Apr 30, 2013 · 8 comments
Closed

[Errno 36] File name too long. -o templates don't support long names #813

Jimmm opened this issue Apr 30, 2013 · 8 comments

Comments

@Jimmm
Copy link

@Jimmm Jimmm commented Apr 30, 2013

I think I've found a problem:
youtube-dl can't handle long templates.

Proof:
youtube-dl -o "02 Linear equations - 13 Evaluating expressions with unknown variables - 001 Evaluating expressions where individual variable values are unknown.mp4" TIwGXn4NalM
[youtube] Setting language
[youtube] TIwGXn4NalM: Downloading video webpage
[youtube] TIwGXn4NalM: Downloading video info webpage
[youtube] TIwGXn4NalM: Extracting video information
ERROR: unable to open for writing: [Errno 36] File name too long: '02 Linear equations - 13 Evaluating expressions with unknown variables - 001 Evaluating expressions where individual variable values are unknown.mp4.part'

@phihag
Copy link
Contributor

@phihag phihag commented Apr 30, 2013

This is a limitation of your filesystem (layer); typing

touch  "02 Linear equations - 13 Evaluating expressions with unknown variables - 001
Evaluating expressions where individual variable values are unknown.mp4.part"

should result in a similar error message.

By default, as a crude heuristic, youtube-dl limits titles (which typically account for the longest part in a filename) to 200 characters. What should we do when your filesystem does not support the name you want? Bear in mind that shortening is not a good idea in general, since that would break scripts that (rightfully) expect us not to silently change the file name.

@phihag phihag closed this Apr 30, 2013
@Xonshiz
Copy link

@Xonshiz Xonshiz commented Jul 11, 2016

Isn't there any work around for this? I had a similar problem with a crunchyroll link 👍
http://www.crunchyroll.com/one-piece/episode-749-the-sword-technique-heats-up-law-and-zoro-finally-appear-715239?p360=1

@TRox1972
Copy link
Contributor

@TRox1972 TRox1972 commented Jul 11, 2016

@Xonshiz Specify a shorter output name using -o

@Xonshiz
Copy link

@Xonshiz Xonshiz commented Jul 11, 2016

@TRox1972 I'm already following it.

-o "/Output/ %(title)s %(format)s.%(ext)s

@TRox1972
Copy link
Contributor

@TRox1972 TRox1972 commented Jul 11, 2016

@Xonshiz The title is too long to be included. You could e.g. use -o "/Output/%(id)s.%(ext)s" instead

@amosshi
Copy link

@amosshi amosshi commented May 12, 2020

There is a parameter --restrict-filenames to get a shorter name could help.

@defead
Copy link

@defead defead commented Jun 14, 2020

As it's using the python format , use '%(title).20s' to truncate a long title to 20 char limit.

Info: string format
Truncating long strings : https://pyformat.info/

@zz5678
Copy link

@zz5678 zz5678 commented Jul 10, 2020

actually, I recommend such alias for fast downloading on youtuble-dl:

alias yt='youtube-dl --proxy http://127.0.0.1:1080 -o "$HOME/video/%(title).230s.%(ext)s"'

the filename limited to 230 characters, enough length for like:
https://twitter.com/ABC/status/1180190308509859840

errors occur if no such processing:

ERROR: unable to open for writing: [Errno 63] File name too long: '/Users/mm/temp/ABC News - Swedish climate activist Greta Thunberg at climate strike in Iowa - “We teenagers and children shouldn’t have to take the responsibility. But right now, the world leaders keep acting like children, and somebody needs to be the adult in the room.”.mp4.part'

especially for those people in China mainland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.