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

[noco.tv] TypeError: Unicode-objects must be encoded before hashing #3816

Closed
ianuxfr opened this issue Sep 22, 2014 · 6 comments
Closed

[noco.tv] TypeError: Unicode-objects must be encoded before hashing #3816

ianuxfr opened this issue Sep 22, 2014 · 6 comments

Comments

@ianuxfr
Copy link

@ianuxfr ianuxfr commented Sep 22, 2014

Still no joy since 7522976

youtube-dl -f best --verbose http://noco.tv/emission/14537/nolife/le-point-info/the-place-to-be-demain
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--netrc', '--prefer-ffmpeg', '--output', '%(title)s.%(ext)s', '-f', 'best', '--verbose', 'http://noco.tv/emission/14537/nolife/le-point-info/the-place-to-be-demain']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.09.22
[debug] Python version 3.4.1 - Linux-3.16.3-1-ck-i686-with-arch
[debug] Proxy map: {}
[Noco] Logging in as ianux
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2014.09.22', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 430, in main
    _real_main(argv)
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 420, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1067, in download
    self.extract_info(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 524, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py", line 180, in extract
    return self._real_extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/noco.py", line 86, in _real_extract
    video_id, 'Downloading video JSON')
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/noco.py", line 65, in _call_api
    tk = hashlib.md5(hashlib.md5(ts).hexdigest() + '#8S?uCraTedap6a').hexdigest()
TypeError: Unicode-objects must be encoded before hashing
@ianuxfr
Copy link
Author

@ianuxfr ianuxfr commented Sep 22, 2014

Still happening with 2014.09.22.1:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--netrc', '--prefer-ffmpeg', '--output', '%(title)s.%(ext)s', '--verbose', 'http://noco.tv/emission/14537/nolife/le-point-info/the-place-to-be-demain']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.09.22.1
[debug] Python version 3.4.1 - Linux-3.16.3-1-ck-i686-with-arch
[debug] Proxy map: {}
[Noco] Logging in as ianux
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2014.09.22.1', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 430, in main
    _real_main(argv)
  File "/usr/lib/python3.4/site-packages/youtube_dl/__init__.py", line 420, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 1067, in download
    self.extract_info(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 524, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py", line 180, in extract
    return self._real_extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/noco.py", line 86, in _real_extract
    video_id, 'Downloading video JSON')
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/noco.py", line 65, in _call_api
    tk = hashlib.md5(hashlib.md5(ts).hexdigest() + '#8S?uCraTedap6a').hexdigest()
TypeError: Unicode-objects must be encoded before hashing
@naglis
Copy link
Collaborator

@naglis naglis commented Sep 22, 2014

Thanks for the report. This issue seems to be specific to Python 3. If you really need it, you might try running youtube-dl with Python 2 (2.6 or 2.7), until it is resolved, I think it should work (at least for this issue).

@dstftw dstftw closed this in f7d159c Sep 23, 2014
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 23, 2014

Sorry, my bad. Should work in next version. Thanks for the report.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 23, 2014

Hey @naglis, feel free to fix if you catch anyone's bugs.

@ianuxfr
Copy link
Author

@ianuxfr ianuxfr commented Sep 23, 2014

Indeed it works with 2014.09.22.1 build against python 2. I will wait for f7d159c to be included in the next release to see if it works with python 3.

@ianuxfr
Copy link
Author

@ianuxfr ianuxfr commented Sep 24, 2014

I've just tested 2014.09.24.1 and it works with python 3. Great job!

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.