python-youtube-api icon indicating copy to clipboard operation
python-youtube-api copied to clipboard

Traceback caused when fetching comments from video because of "items"

Open coffeebreak42 opened this issue 5 years ago • 2 comments

On multiple machines I've been getting this error when using the fetch comment feature from a video url: Traceback (most recent call last): File "main.py", line 58, in main() File "main.py", line 52, in main vc.get_video_comments() File "/content/python-youtube-api/youtube/video_comments.py", line 52, in get_video_comments self.load_comments(url_response) File "/content/python-youtube-api/youtube/video_comments.py", line 27, in load_comments for item in mat["items"]: KeyError: 'items'

Anyone else getting this problem or have figured it out?

coffeebreak42 avatar Feb 01 '20 06:02 coffeebreak42

I got the same problem, and here is the Youtube API response : {'error': {'message': 'Access Not Configured. YouTube Data API has not been used in project 67650486589 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=6xxxxx9 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.', 'code': 403, 'errors': [{'message': 'Access Not Configured. YouTube Data API has not been used in project 6xxxxxxxxxxxx9 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=6xxxxx89 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.', 'extendedHelp': 'https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=6xxxxxx89', 'domain': 'usageLimits', 'reason': 'accessNotConfigured'}]}}

You need to enable your project (credentials) on the Youtube console

MoezBHH avatar Feb 10 '20 13:02 MoezBHH

I got the same problem, and as @MoezBHH said, we need to enable the "YouTube Data API v3" in the site https://console.developers.google.com/apis:

menu ->> APIs & Services ->> library ->> search for "YouTube Data API v3" ->> enable

wait for a while and retry your code 😉

JqKOU avatar Aug 25 '20 04:08 JqKOU