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

`I/O operation on closed file.` error on Python 3.7 #17447

Closed
remitamine opened this issue Sep 6, 2018 · 1 comment
Closed

`I/O operation on closed file.` error on Python 3.7 #17447

remitamine opened this issue Sep 6, 2018 · 1 comment

Comments

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Sep 6, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.09.01. 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 2018.09.01

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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)
  • Question
  • Other

Python 3.7:

python __main__.py -v -F https://www.bbc.co.uk/programmes/b00795qb
[debug] System config: []
[debug] User config: ['-f', 'best[height<=768]/bestvideo[height<=768]+bestaudio/best', '--hls-prefer-ffmpeg', '--external-downloader', 'curl', '--sub-format', 'ass/tt/ttml/dfxp/scc/vtt/srt/sami/best']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.bbc.co.uk/programmes/b00795qb']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.09.01
[debug] Git HEAD: 2d4fe594c
[debug] Python version 3.7.0 (CPython) - Linux-4.18.5-arch1-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg n4.0.2, ffprobe n4.0.2, rtmpdump 2.4
[debug] Proxy map: {}
[bbc.co.uk] b00795qb: Downloading video page
[bbc.co.uk] b00795qb: Downloading playlist JSON
[bbc.co.uk] b006x0pv: Downloading media selection XML
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/amine/youtube-dl/youtube_dl/__init__.py", line 472, in main
    _real_main(argv)
  File "/home/amine/youtube-dl/youtube_dl/__init__.py", line 462, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/amine/youtube-dl/youtube_dl/YoutubeDL.py", line 2001, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/home/amine/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 502, in extract
    ie_result = self._real_extract(url)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 567, in _real_extract
    programme_id, title, description, duration, formats, subtitles = self._download_playlist(group_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 463, in _download_playlist
    formats, subtitles = self._download_media_selector(programme_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 333, in _download_media_selector
    mediaselector_url % programme_id, programme_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 344, in _download_media_selector_url
    expected_status=(403, 404))
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 809, in _download_xml
    expected_status=expected_status)
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 787, in _download_xml_handle
    expected_status=expected_status)
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 631, in _download_webpage_handle
    content = self._webpage_read_content(urlh, url_or_request, video_id, note, errnote, fatal, encoding=encoding)
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 681, in _webpage_read_content
    webpage_bytes = urlh.read()
  File "/usr/lib/python3.7/tempfile.py", line 481, in func_wrapper
    return func(*args, **kwargs)
ValueError: I/O operation on closed file.

Python 2.7:

python2 __main__.py -v -F https://www.bbc.co.uk/programmes/b00795qb
[debug] System config: []
[debug] User config: [u'-f', u'best[height<=768]/bestvideo[height<=768]+bestaudio/best', u'--hls-prefer-ffmpeg', u'--external-downloader', u'curl', u'--sub-format', u'ass/tt/ttml/dfxp/scc/vtt/srt/sami/best']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.bbc.co.uk/programmes/b00795qb']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.09.01
[debug] Git HEAD: 2d4fe594c
[debug] Python version 2.7.15 (CPython) - Linux-4.18.5-arch1-1-ARCH-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg n4.0.2, ffprobe n4.0.2, rtmpdump 2.4
[debug] Proxy map: {}
[bbc.co.uk] b00795qb: Downloading video page
[bbc.co.uk] b00795qb: Downloading playlist JSON
[bbc.co.uk] b006x0pv: Downloading media selection XML
[bbc.co.uk] b006x0pv: Downloading media selection XML
ERROR: bbc.co.uk returned error: geolocation
Traceback (most recent call last):
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 333, in _download_media_selector
    mediaselector_url % programme_id, programme_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 345, in _download_media_selector_url
    return self._process_media_selector(media_selection, programme_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 352, in _process_media_selector
    for media in self._extract_medias(media_selection):
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 304, in _extract_medias
    raise BBCCoUkIE.MediaSelectionError(error.get('id'))
MediaSelectionError
Traceback (most recent call last):
  File "/home/amine/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/home/amine/youtube-dl/youtube_dl/extractor/common.py", line 502, in extract
    ie_result = self._real_extract(url)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 567, in _real_extract
    programme_id, title, description, duration, formats, subtitles = self._download_playlist(group_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 463, in _download_playlist
    formats, subtitles = self._download_media_selector(programme_id)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 339, in _download_media_selector
    self._raise_extractor_error(last_exception)
  File "/home/amine/youtube-dl/youtube_dl/extractor/bbc.py", line 326, in _raise_extractor_error
    expected=True)
ExtractorError: bbc.co.uk returned error: geolocation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.