You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having the same issue too, while I'll try to fix the code, please refer to YouTube API tutorial instead (and that's what I'm currently using as well):
I understand this is an old issue, but I have found a fix for those who are still expecting one.
YouTube now uses var ytInitialData instead of window["ytInitialData"] . You can change line 50, or any line close by that creates the data_str variable from this:
Getting error:
`runfile('C:/Users/Jeff/Downloads/untitled1.py', wdir='C:/Users/Jeff/Downloads')
Traceback (most recent call last):
File "C:\Users\Jeff\Downloads\untitled1.py", line 120, in
for count, comment in enumerate(get_comments(url)):
File "C:\Users\Jeff\Downloads\untitled1.py", line 50, in get_comments
data = json.loads(data_str)
File "C:\Users\Jeff\anaconda3\lib\json_init_.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Users\Jeff\anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Jeff\anaconda3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
JSONDecodeError: Expecting value`
The text was updated successfully, but these errors were encountered: