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

Weird error #8

Open
BoiGeezums opened this issue May 19, 2021 · 0 comments
Open

Weird error #8

BoiGeezums opened this issue May 19, 2021 · 0 comments

Comments

@BoiGeezums
Copy link

No idea what I'm doing re: coding whatsoever, just downloaded python like 20 mins ago to try your tool and I'm getting this error when I try to run the replay option:
C:\Windows\System32>yttool --replay https://youtu.be/QmwdHxjoUiI
Traceback (most recent call last):
File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\program files\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\Python39\Scripts\yttool.exe_main
.py", line 7, in
File "c:\program files\python39\lib\site-packages\yttool.py", line 1086, in main
cfg = filterhtml(html.decode('utf-8'))
File "c:\program files\python39\lib\site-packages\yttool.py", line 360, in filterhtml
result["ldjson"] = json.loads(m.group(1))
File "c:\program files\python39\lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
File "c:\program files\python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\program files\python39\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 1 column 213 (char 212)

I also tested with a different video, resulting in a different error while getting some of the comments:
C:\Windows\System32>yttool --replay https://youtu.be/vYl6VaSieHQ
Traceback (most recent call last):
File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\Python39\Scripts\yttool.exe_main
.py", line 7, in
File "c:\program files\python39\lib\site-packages\yttool.py", line 1105, in main
txt.recursechat()
File "c:\program files\python39\lib\site-packages\yttool.py", line 452, in recursechat
self.monitorchat(js["initdata"])
File "c:\program files\python39\lib\site-packages\yttool.py", line 494, in monitorchat
respjson = self.yt.getlivechat(cont)
File "c:\program files\python39\lib\site-packages\yttool.py", line 232, in getlivechat
return self.httpreq(url + "?" + urllib.parse.urlencode(query), json.dumps(postdata).encode('utf-8'))
File "c:\program files\python39\lib\site-packages\yttool.py", line 160, in httpreq
response = self.opener.open(req, **kwargs)
File "c:\program files\python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "c:\program files\python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "c:\program files\python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "c:\program files\python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "c:\program files\python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
(comments started here)

It works fine when using the example link you used, but when I used videos I wanted to get the replay for, it didn't.

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

No branches or pull requests

1 participant