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

Error while trying to download episode from crunchyroll #25294

Closed
jyroman opened this issue May 16, 2020 · 5 comments
Closed

Error while trying to download episode from crunchyroll #25294

jyroman opened this issue May 16, 2020 · 5 comments

Comments

@jyroman
Copy link

@jyroman jyroman commented May 16, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.05.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

.\youtube-dl.exe --write-sub --sub-lang frFR --embed-subs --cookies cookies-cr.txt -v https://www.crunchyroll.com/fr/senran-kagura-shinovi-master/episode-1-change-the-world-778014                                 [debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--write-sub', '--sub-lang', 'frFR', '--embed-subs', '--cookies', 'cookies-cr.txt', '-v', 'https://www.crunchyroll.com/fr/senran-kagura-shinovi-master/episode-1-change-the-world-778014']
[debug] Encodings: locale cp65001, fs mbcs, out cp65001, pref cp65001
[debug] youtube-dl version 2020.05.08
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg git-2020-01-15-0dc0837, ffprobe git-2020-01-15-0dc0837
[debug] Proxy map: {}
[crunchyroll] 778014: Downloading webpage
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\__init__.py", line 474, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\__init__.py", line 464, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\YoutubeDL.py", line 2019, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\YoutubeDL.py", line 797, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\common.py", line 530, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\crunchyroll.py", line 426, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\crunchyroll.py", line 277, in _download_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\common.py", line 794, in _download_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\common.py", line 660, in _download_webpage_handle
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\extractor\common.py", line 627, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\YoutubeDL.py", line 2238, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp4z7swgz7\build\youtube_dl\utils.py", line 2574, in http_open
  File "C:\Python\Python34\lib\urllib\request.py", line 1183, in do_open
  File "C:\Python\Python34\lib\http\client.py", line 1137, in request
  File "C:\Python\Python34\lib\http\client.py", line 1177, in _send_request
  File "C:\Python\Python34\lib\http\client.py", line 1109, in putheader
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 1316: ordinal not in range(256)

Description

Hello,

When trying to download videos from crunchyroll, I run into an error with character encoding, I've tried setting up another locale but I still run into the same issue.

@ArturiaPendragon
Copy link

@ArturiaPendragon ArturiaPendragon commented May 28, 2020

Same here :

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'-f', u'-i', u'https://www.crunchyroll.com/fr/food-wars-shokugeki-no-soma/episode-1-final-exams-794780', u'--user-agent', u'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0', u'--cookies', u'cookies-fr.txt']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.05.08
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-4-amd64-x86_64-with-debian-9.12
[debug] exe versions: ffmpeg N-97229-g932493f9c2, ffprobe N-97229-g932493f9c2
[debug] Proxy map: {}
[crunchyroll] 794780: Downloading webpage
ERROR: 'ascii' codec can't encode character u'\u2019' in position 1540: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/crunchyroll.py", line 426, in _real_extract
    headers=self.geo_verification_headers())
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/crunchyroll.py", line 277, in _download_webpage
    return super(CrunchyrollBaseIE, self)._download_webpage(request, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 794, in _download_webpage
    expected_status=expected_status)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 660, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 2574, in http_open
    req)
  File "/usr/lib/python2.7/urllib2.py", line 1195, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1042, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1081, in _send_request
    self.putheader(hdr, value)
  File "/usr/lib/python2.7/httplib.py", line 1017, in putheader
    values = [str(v) for v in values]
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 1540: ordinal not in range(128)
@ArturiaPendragon
Copy link

@ArturiaPendragon ArturiaPendragon commented May 28, 2020

I fixed this with Python3 and passing clean cookies (install youtube-dl with pip3).

@jyroman
Copy link
Author

@jyroman jyroman commented May 29, 2020

I fixed this with Python3 and passing clean cookies (install youtube-dl with pip3).

I've tried by installing python3 and pip install but I get the same error, which arguments do you use ?

@ArturiaPendragon
Copy link

@ArturiaPendragon ArturiaPendragon commented May 29, 2020

Commands line used (for subtitles download) :

youtube-dl --verbose -i "http://www.crunchyroll.com/food-wars-shokugeki-no-soma/episode-1-final-exams-794780" --user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' --cookies cookies-fr.txt --skip-download --write-sub --sub-lang frFR --sub-format ass --no-check-certificate

Results :

[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.05.29
[debug] Python version 3.5.3 (CPython) - Linux-4.9.0-4-amd64-x86_64-with-debian-9.12
[debug] exe versions: ffmpeg N-97993-gc0f01eaf12, ffprobe N-97993-gc0f01eaf12
[debug] Proxy map: {}
[crunchyroll] 794780: Downloading webpage
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-frFR information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-ptBR information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-esES information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-enUS information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-deDE information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-ruRU information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-esLA information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-itIT information
[crunchyroll] 794780: Downloading adaptive_hls-audio-jaJP-hardsub-arME information
[crunchyroll] 794780: Downloading media info
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: Food Wars! Shokugeki no Soma Épisode 1 – Un parfum d'imprévu-794780.frFR.ass

Env :

youtube-dl 2020.05.29
Python 3.5.3
npm 6.14.4
Distributor ID: Debian
Description: Debian GNU/Linux 9.12 (stretch)
Release: 9.12
Codename: stretch
x264 0.160.3000 33f9e14
x265 [info]: HEVC encoder version 0.0
x265 [info]: build info [Linux][GCC 6.3.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
ffmpeg version N-97993-gc0f01eaf12 Copyright (c) 2000-2020 the FFmpeg developers
mkvmerge v38.0.0 ('The Silent Type') 64-bit
MediaInfoLib - v17.10

Cookies cleaning : I keep only the value of

__cfuid, __cf_bm, session_id, VILOS_DRM_ROLLOUT

@jyroman
Copy link
Author

@jyroman jyroman commented May 29, 2020

Alright, it worked ! After some testing, my cookies file was messed up, cleaning it fixed the issue, Thanks !

@jyroman jyroman closed this May 29, 2020
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.