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

[niconico] TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str. #17393

Closed
stovni3333 opened this issue Aug 31, 2018 · 1 comment

Comments

@stovni3333
Copy link

@stovni3333 stovni3333 commented Aug 31, 2018

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

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', 'http://www.nicovideo.jp/watch/sm33755147']
[debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932
[debug] youtube-dl version 2018.08.28
[debug] Python version 3.4.4 (CPython) - Windows-8.1-6.3.9600
[debug] exe versions: ffmpeg N-81256-gd3426fb, ffprobe N-81256-gd3426fb
[debug] Proxy map: {}
[niconico] sm33755147: Downloading webpage
[niconico] sm33755147: Downloading JSON metadata for h264_200kbps_360p-aac_64kbps
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\__init__.py", line 472, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\__init__.py", line 462, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 2001, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 792, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\common.py", line 502, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\niconico.py", line 343, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\niconico.py", line 253, in _extract_format_for_quality
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\common.py", line 859, in _download_json
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\common.py", line 837, in _download_json_handle
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\common.py", line 627, in _download_webpage_handle
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\extractor\common.py", line 599, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 2211, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 462, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 1113, in do_request_
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Description of your issue, suggested solution and other information

Error occurs for certain niconico URLs. I haven't tested extensively but it seems to occur exclusively on (some) recent videos (~July 2018).

e.g. http://www.nicovideo.jp/watch/sm33642362 -- works
http://www.nicovideo.jp/watch/sm33755147 -- fails with above error

@Gorfiend
Copy link
Contributor

@Gorfiend Gorfiend commented Aug 31, 2018

I'm seeing the same issue. Some videos work, some don't (though both of the examples given fail for me).

I also noticed that running youtube-dl with python2 instead of python3 works for every video I've tried.

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.