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

Bad file descriptor errno 9 #8344

Open
oguzhankahyaoglu opened this issue Jan 28, 2016 · 10 comments
Open

Bad file descriptor errno 9 #8344

oguzhankahyaoglu opened this issue Jan 28, 2016 · 10 comments

Comments

@oguzhankahyaoglu
Copy link

@oguzhankahyaoglu oguzhankahyaoglu commented Jan 28, 2016

Hello there :)

I was developing a youtube-downloader and i was stuck with some of videos. Then i found your repository, and started using your executable by integrating to my application. My main iade was to sycn a favourite playlist for my offline-listening purposes.

Anyways, i am getting this error. This can be for a very specific issue. The video is a very old kind. I was preferring to download at most 720p quality.

If you need any details further, i can provide you. As stated below, I am using windows 7 ultimate, x64.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'http://www.youtube.com/watch?v=w6QGe-pXgdI', u'-o', u'D:_Videos\YT Favourites\0259-%(title)s.%(ext)s', u'--no-continue', u'-v', u'-w', u'-i']
[debug] Encodings: locale cp1254, fs mbcs, out None, pref cp1254
[debug] youtube-dl version 2016.01.01
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-50911-g9efcfbe
[debug] Proxy map: {}
ERROR: [Errno 9] Bad file descriptor
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 665, in extract_info
File "youtube_dl\extractor\common.pyo", line 291, in extract
File "youtube_dl\extractor\youtube.pyo", line 1124, in _real_extract
File "youtube_dl\extractor\common.pyo", line 443, in _download_webpage
File "youtube_dl\extractor\common.pyo", line 350, in _download_webpage_handle
File "youtube_dl\extractor\common.pyo", line 323, in _request_webpage
File "youtube_dl\extractor\common.pyo", line 508, in report_download_webpage
File "youtube_dl\extractor\common.pyo", line 500, in to_screen
File "youtube_dl\YoutubeDL.pyo", line 423, in to_screen
File "youtube_dl\YoutubeDL.pyo", line 437, in to_stdout
File "youtube_dl\YoutubeDL.pyo", line 426, in _write_string
File "youtube_dl\utils.pyo", line 1142, in write_string
IOError: [Errno 9] Bad file descriptor

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 28, 2016

Did you run youtube-dl.exe directly in cmd.exe?

@oguzhankahyaoglu
Copy link
Author

@oguzhankahyaoglu oguzhankahyaoglu commented Jan 28, 2016

Nope, i am calling it from my application, and reading both standart output and error streams to check whether there was an error processing the request or not.
You can take a look at my repository: [https://github.com/oguzhankahyaoglu/YoutubeListSyncronizer/blob/master/v2/YoutubeListSyncronizer/YoutubeListSyncronizer/YoutubeDownloadExe.cs]

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 29, 2016

I've played with v2 https://github.com/oguzhankahyaoglu/YoutubeListSyncronizer/blob/master/v2/Executable/YoutubeListSyncronizer.exe. Here are my steps:

  1. Run the program
  2. Click OK to use the default playlist URL
  3. Wait for playlist downloading and then click OK
  4. Uncheck all videos and the click on the first one
  5. Click "Start Downloading"
  6. Choose a temporary empty folder
  7. Click OK

Everything looks OK. How did you get the errors above?

@oguzhankahyaoglu
Copy link
Author

@oguzhankahyaoglu oguzhankahyaoglu commented Jan 29, 2016

okay you were good. and my program runs fine. it just gave that error for a very specific video, the one i used in verbose log. its chris brown's run it song :)

you can try to use its link for downloading. it might be a temporary error by the way. anyway if it was a temp issue, the error message should be more descriptive.

Sent from my ASUS

-------- Original Message --------
From:Yen Chi Hsuan notifications@github.com
Sent:Fri, 29 Jan 2016 20:18:47 +0200
To:rg3/youtube-dl youtube-dl@noreply.github.com
Cc:Oğuzhan Kahyaoğlu oguzhan.kahyaoglu@yahoo.com
Subject:Re: [youtube-dl] Bad file descriptor errno 9 (#8344)

I've played with v2 https://github.com/oguzhankahyaoglu/YoutubeListSyncronizer/blob/master/v2/Executable/YoutubeListSyncronizer.exe. Here are my steps:

Run the programClick OK to use the default playlist URLWait for playlist downloading and then click OKUncheck all videos and the click on the first oneClick "Start Downloading"Choose a temporary empty folderClick OK

Everything looks OK. How did you get the errors above?


Reply to this email directly or view it on GitHub.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 29, 2016

Pasting http://www.youtube.com/watch?v=w6QGe-pXgdI to the program leads me to a successful download. FWIW, I have .NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1 installed.

@oguzhankahyaoglu
Copy link
Author

@oguzhankahyaoglu oguzhankahyaoglu commented Apr 23, 2016

Hi dude,

I am getting this error again for ALL of my yt download requests. Do i get banned ? :)
I dont think so. I am able to reach all these videos from yt's website. I got some articles btw for this issue.

For debug outputs;

url: http://www.youtube.com/watch?v=Bznxx12Ptl0


[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'http://www.youtube.com/watch?v=Bznxx12Ptl0', u'-o', u'D:\\_Videos\\YT Favourites\\0086-%(title)s.%(ext)s', u'--no-continue', u'-w', u'-i', u'-v', u'-f', u'mp4[height<=?720]']
[debug] Encodings: locale cp1254, fs mbcs, out None, pref cp1254
[debug] youtube-dl version 2016.04.19
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.pyo", line 671, in extract_info
  File "youtube_dl\extractor\common.pyo", line 341, in extract
  File "youtube_dl\extractor\youtube.pyo", line 1210, in _real_extract
  File "youtube_dl\extractor\common.pyo", line 501, in _download_webpage
  File "youtube_dl\extractor\common.pyo", line 408, in _download_webpage_handle
  File "youtube_dl\extractor\common.pyo", line 373, in _request_webpage
  File "youtube_dl\extractor\common.pyo", line 566, in report_download_webpage
  File "youtube_dl\extractor\common.pyo", line 558, in to_screen
  File "youtube_dl\YoutubeDL.pyo", line 428, in to_screen
  File "youtube_dl\YoutubeDL.pyo", line 442, in to_stdout
  File "youtube_dl\YoutubeDL.pyo", line 431, in _write_string
  File "youtube_dl\utils.pyo", line 1174, in write_string
IOError: [Errno 9] Bad file descriptor

Another;

url: http://www.youtube.com/watch?v=CZUwh21Nhgw
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'http://www.youtube.com/watch?v=CZUwh21Nhgw', u'-o', u'D:\\_Videos\\YT Favourites\\0127-%(title)s.%(ext)s', u'--no-continue', u'-w', u'-i', u'-v', u'-f', u'mp4[height<=?720]']
[debug] Encodings: locale cp1254, fs mbcs, out None, pref cp1254
[debug] youtube-dl version 2016.04.19
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.pyo", line 671, in extract_info
  File "youtube_dl\extractor\common.pyo", line 341, in extract
  File "youtube_dl\extractor\youtube.pyo", line 1210, in _real_extract
  File "youtube_dl\extractor\common.pyo", line 501, in _download_webpage
  File "youtube_dl\extractor\common.pyo", line 408, in _download_webpage_handle
  File "youtube_dl\extractor\common.pyo", line 373, in _request_webpage
  File "youtube_dl\extractor\common.pyo", line 566, in report_download_webpage
  File "youtube_dl\extractor\common.pyo", line 558, in to_screen
  File "youtube_dl\YoutubeDL.pyo", line 428, in to_screen
  File "youtube_dl\YoutubeDL.pyo", line 442, in to_stdout
  File "youtube_dl\YoutubeDL.pyo", line 431, in _write_string
  File "youtube_dl\utils.pyo", line 1174, in write_string
IOError: [Errno 9] Bad file descriptor

For possible solutions, i got these links;

http://stackoverflow.com/questions/15958026/getting-errno-9-bad-file-descriptor-in-python-socket
http://stackoverflow.com/questions/7686275/what-can-lead-to-ioerror-errno-9-bad-file-descriptor-during-os-system

@oguzhankahyaoglu
Copy link
Author

@oguzhankahyaoglu oguzhankahyaoglu commented Apr 23, 2016

I tried to run this app from another computer and it succeeds for same urls. I think, YT has banned me. but, shouldnt i access the webpage too?

Anyway, if you check the app, you will be able to download without any errors, probably. In such cases, you should provide a better error message in my opinion. YT should be sending different content for such cases.

For your debugging purposes, I can provide you remote connection btw.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 23, 2016

From your logs it's a system (Windows, .NET Framework, Python, etc.) problem rather than a network one.

Is it working if you run the following command directly in CMD.EXE or PowerShell?

youtube-dl "http://www.youtube.com/watch?v=Bznxx12Ptl0" -o "D:\_Videos\YT Favourites\0086-%(title)s.%(ext)s" --no-continue -w  -i -v -f "mp4[height<=?720]"
@oguzhankahyaoglu
Copy link
Author

@oguzhankahyaoglu oguzhankahyaoglu commented Apr 23, 2016

Yes it does, but how? I am confused. I am passing these arguments to youtube-dl.
I thought of priviledges, but i am running this app in administrator mode.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 23, 2016

Could you do more tests:

  1. Download and install Python 2 from https://www.python.org/downloads/
  2. Run C:\Python27\python.exe -c "import sys; sys.stdout.write(b'abcd'); sys.stdout.flush()" in CMD.EXE or PowerShell.
  3. Run the same command from C#.
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
2 participants
You can’t perform that action at this time.