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

OSError: [Errno 22] Invalid argument #13177

Open
4 tasks done
BossDarkReaper opened this issue May 21, 2017 · 2 comments
Open
4 tasks done

OSError: [Errno 22] Invalid argument #13177

BossDarkReaper opened this issue May 21, 2017 · 2 comments

Comments

@BossDarkReaper
Copy link

BossDarkReaper commented May 21, 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.05.18.1. 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.05.18.1

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)

MY command Line:
$@"-v --format m4a --hls-prefer-ffmpeg -o ""C:/DIRECTORY/%(title)s.%(ext)s"" {path}"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--format', 'm4a', '--hls-prefer-ffmpeg', '-o', 'C:/Users/johni/Desktop/MusicDiscord/MusicBotV2/MusicBot/src/MusicBotV2/Music/%(title)s.%(ext)s', 'https://www.youtube.com/watch?v=NVb_3xpa55c']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2017.05.18.1
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg 3.2.4
[debug] Proxy map: {}
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\__init__.py", line 465, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\__init__.py", line 455, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\YoutubeDL.py", line 1896, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\YoutubeDL.py", line 760, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 433, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\youtube.py", line 1397, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 634, in _download_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 531, in _download_webpage_handle
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 487, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 699, in report_download_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\extractor\common.py", line 691, in to_screen
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\YoutubeDL.py", line 472, in to_screen
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\YoutubeDL.py", line 486, in to_stdout
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\YoutubeDL.py", line 475, in _write_string
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpwgfs80it\build\youtube_dl\utils.py", line 1405, in write_string
OSError: [Errno 22] Invalid argument
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'>
OSError: [Errno 22] Invalid argument
...
<end of log>

Description of your issue, suggested solution and other information

I just get this error sometimes not all the time and have no idea why. As the path is not invalid. I am running on Windows 10

@farangkao
Copy link

I got the same error, as it looks like BossDarkReaper is running youtube-dl from a c# application as myself as well.
I could avoid that error, if i changed the Attributes for the Process Method, as follows:

Code produces the error:
Process p = new Process { StartInfo = { RedirectStandardInput = true, RedirectStandardOutput = true, FileName = @"D:\Tools\youtube-dl\youtube-dl.exe", WorkingDirectory = @"D:\MyYouTube", Arguments = arguments } }; p.Start();

Code doesn't produce the error:
Process p = new Process { StartInfo = { RedirectStandardInput = false, RedirectStandardOutput = false, FileName = @"D:\Tools\youtube-dl\youtube-dl.exe", WorkingDirectory = @"D:\MyYouTube", Arguments = arguments } }; p.Start();

Hope this might help.

@Jan02
Copy link

Jan02 commented Nov 2, 2019

you can try

using double quotes for the output parameter (-o) solved the issue with video titles including the ' character.

i.e. youtube-dl.exe -i -o ""V:\downloads\audio\%(title)s.%(ext)s""

an earlier build of ffmpeg
removing the -v option

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

No branches or pull requests

4 participants