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

Can't read utf-8 characters from stdin (Windows only) #16857

Closed
TheBITLINK opened this issue Jun 29, 2018 · 7 comments
Closed

Can't read utf-8 characters from stdin (Windows only) #16857

TheBITLINK opened this issue Jun 29, 2018 · 7 comments

Comments

@TheBITLINK
Copy link

@TheBITLINK TheBITLINK commented Jun 29, 2018

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 this: [x])
  • Use the Preview tab to see what your issue will actually look like

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

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

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

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--dump-json', '--default-search=ytsearch', '-i', '--format=best', '-a', '-']
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkc931nsv\build\youtube_dl\__init__.py", line 472, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkc931nsv\build\youtube_dl\__init__.py", line 93, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkc931nsv\build\youtube_dl\utils.py", line 2116, in read_batch_urls
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpkc931nsv\build\youtube_dl\utils.py", line 2116, in <listcomp>
  File "C:\Python\Python34\lib\encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1: character maps to <undefined>

Description of your issue, suggested solution and other information

For some reason, youtube-dl defaults to the cp1252 encoding when reading from stdin in Windows, if there's an utf-8 character present, it crashes like above. I've tried to override this using both the --encoding parameter and the PYTHONIOENCODING environment variable with no success.

@Hrxn
Copy link

@Hrxn Hrxn commented Jun 29, 2018

When running youtube-dl from CMD.exe?

@TheBITLINK
Copy link
Author

@TheBITLINK TheBITLINK commented Jun 29, 2018

I'm running it from a Node.js app using child_process.spawn

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 29, 2018

Post the data written to stdin.

@TheBITLINK
Copy link
Author

@TheBITLINK TheBITLINK commented Jun 29, 2018

Try with إثس

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 29, 2018

Still no crash.

@Ensjam
Copy link

@Ensjam Ensjam commented Jun 30, 2018

Same issue

@Ensjam
Copy link

@Ensjam Ensjam commented Jun 30, 2018

Try with "ماجد العيسى فري ستايل"

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