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

ERROR: unable to open for writing: [Errno 36] File name too long @ ubuntu server 14.04 #12351

Closed
orangercat opened this issue Mar 4, 2017 · 2 comments

Comments

@orangercat
Copy link

@orangercat orangercat commented Mar 4, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.03.02. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.03.02

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • [ x] Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

Request Method:	POST
Request URL:	
Django Version:	1.10.5
Exception Type:	DownloadError
Exception Value:	
ERROR: unable to open for writing: [Errno 36] File name too long: './download/പല ഐറ്റംസ് കയ്യിലുണ്ടെന്ന് പറഞ്ഞപ്പോൾ ഇങ്ങനൊരു ഐറ്റം ആകുമെന്ന് ഒരിക്കലും പ്രതീക്ഷിച്ച മോളേ......mp4.part'
Exception Location:	/usr/local/lib/python3.4/dist-packages/youtube_dl/YoutubeDL.py in trouble, line 540
Python Executable:	/usr/local/bin/uwsgi
Python Version:	3.4.3
Python Path:	
['.',
 '',
 '/usr/lib/python3.4',
 '/usr/lib/python3.4/plat-x86_64-linux-gnu',
 '/usr/lib/python3.4/lib-dynload',
 '/usr/local/lib/python3.4/dist-packages',
 '/usr/lib/python3/dist-packages']
...
<end of log>
debug] Invoking downloader on 'https://r1---sn-n4v7kn7l.googlevideo.com/videoplayback?id=6f53638c2b065c6a&itag=134&source=youtube&requiressl=yes&mn=sn-n4v7kn7l&mm=31&initcwndbps=5260000&mv=m&pl=20&ms=au&ratebypass=yes&mime=video/mp4&gir=yes&clen=1377658&lmt=1488522780279099&dur=56.866&signature=702FDCDE4BCACD5EB8DE299BE822992C0E5F0438.5151A75908F59DD92F15F929FE4F636D4DCE6CC3&mt=1488782605&upn=noB0sDJwOhw&key=dg_yt0&ip=192.241.227.106&ipbits=0&expire=1488804307&sparams=ip,ipbits,expire,id,itag,source,requiressl,mn,mm,initcwndbps,mv,pl,ms,ratebypass,mime,gir,clen,lmt,dur'
ERROR: unable to open for writing: [Errno 36] File name too long: 'പല ഐറ്റംസ് കയ്യിലുണ്ടെന്ന് പറഞ്ഞപ്പോൾ ഇങ്ങനൊരു ഐറ്റം ആകുമെന്ന് ഒരിക്കലും പ്രതീക്ഷിച്ച മോളേ.....-b1NjjCsGXGo.f134.mp4.part'
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/youtube_dl/downloader/http.py", line 175, in real_download
    (stream, tmpfilename) = sanitize_open(tmpfilename, open_mode)
  File "/usr/local/lib/python3.4/dist-packages/youtube_dl/utils.py", line 448, in sanitize_open
    stream = open(encodeFilename(filename), open_mode)
OSError: [Errno 36] File name too long: 'പല ഐറ്റംസ് കയ്യിലുണ്ടെന്ന് പറഞ്ഞപ്പോൾ ഇങ്ങനൊരു ഐറ്റം ആകുമെന്ന് ഒരിക്കലും പ്രതീക്ഷിച്ച മോളേ.....-b1NjjCsGXGo.f134.mp4.part'


If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

https://www.youtube.com/watch?v=b1NjjCsGXGo

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

hi i use

ydl_opts = {
            'outtmpl': '/%(title)s.%(ext)s',

@ ubuntu server 14.04. it said file name too long, but this code is fine at MacOS. i want to know how i can output filename with only a specify long (ex: 20 byte).thank you

@orangercat orangercat changed the title ERROR: unable to open for writing @ ubuntu server 14.04 ERROR: unable to open for writing: [Errno 36] File name too long @ ubuntu server 14.04 Mar 5, 2017
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 12, 2017

Hello @orangercat, first sorry for the late response. This problem is already discussed in #5921 and there's no simple and generic solution yet. For Python applications, you can inherit the YoutubeDL class, override prepare_filename() and implement your own filename truncation logic.

@yan12125 yan12125 closed this May 12, 2017
@wallebot1
Copy link

@wallebot1 wallebot1 commented Dec 13, 2017

I have same problem with intermedio program.
http://www.atresplayer.com/television/programas/el-intermedio/temporada-12/capitulo-65-12-12-17-crtica-wyoming-sanidad-pblica-antes-llambamos-seguridad-social-ahora-siniestro-total_2017121200840.html

Many time title is 255 chars bigger.

I think this is a good advice
For Python applications, you can inherit the YoutubeDL class, override prepare_filename() and implement your own filename truncation logic.

@ytdl-org ytdl-org deleted a comment from sputnick-dev Apr 14, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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