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 in python module YoutubeDL fileno = out.fileno() #4733

Closed
carvalhomr opened this issue Jan 17, 2015 · 3 comments
Closed

error in python module YoutubeDL fileno = out.fileno() #4733

carvalhomr opened this issue Jan 17, 2015 · 3 comments

Comments

@carvalhomr
Copy link

@carvalhomr carvalhomr commented Jan 17, 2015

Thank You for the great app;
But now I´m having some troubles in using youtube-dl as python module. I´ve updated my last version in 05.01.2015. Since then i get the same error over and over and couldn´t download any file any more.
Can you help me ?

Here´s the error:

from youtube_dl import YoutubeDL
ydl = YoutubeDL()
ydl.add_default_info_extractors()
nfo =ydl.extract_info('http://www.youtube.com/watch?v=giNdyLY46Mo')

Traceback (most recent call last):
File "<pyshell#10>", line 1, in
nfo =ydl.extract_info('http://www.youtube.com/watch?v=giNdyLY46Mo')
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\YoutubeDL.py", line 600, in extract_info
ie_result = ie.extract(url)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 260, in extract
return self._real_extract(url)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\youtube.py", line 802, in _real_extract
video_webpage = self._download_webpage(url, video_id)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 388, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 312, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 286, in _request_webpage
self.report_download_webpage(video_id)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 452, in report_download_webpage
self.to_screen('%s: Downloading webpage' % video_id)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\extractor\common.py", line 444, in to_screen
self._downloader.to_screen('[%s] %s' % (self.IE_NAME, msg))
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\YoutubeDL.py", line 374, in to_screen
return self.to_stdout(message, skip_eol, check_quiet=True)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\YoutubeDL.py", line 388, in to_stdout
self._write_string(output, self._screen_file)
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\YoutubeDL.py", line 377, in _write_string
write_string(s, out=out, encoding=self.params.get('encoding'))
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\utils.py", line 938, in write_string
if _windows_write_string(s, out):
File "C:\Python27\lib\site-packages\youtube_dl-2015.01.16-py2.7.egg\youtube_dl\utils.py", line 874, in _windows_write_string
fileno = out.fileno()
UnsupportedOperation: fileno

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 17, 2015

It looks like the same error as the one you posted some time ago: #2820. It should have been fixed with a383a98.
@phihag: out.fileno() seems to raise UnsupportedOperation, shouldn't we catch it instead of AttributeError?

@phihag
Copy link
Contributor

@phihag phihag commented Jan 17, 2015

@jaimeMF Pseudo-files don't have fileno in the first place, so we should catch both conditions.

@phihag phihag closed this in aa42e87 Jan 23, 2015
@phihag
Copy link
Contributor

@phihag phihag commented Jan 23, 2015

I cannot reproduce this strange error (even on Windows), but we can simply catch it and fall back to the default output stream. I've done exactly that in youtube-dl 2015.01.23.3. I'd appreciate feedback of whether this has fixed your issue.

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
3 participants
You can’t perform that action at this time.