i have a function used to get some statistic details from a group of video_ids. i think im running into an issue with commentCount when there are none on a video. this code works on some channels but breaks when i hit some channels.
## Function to get video detailsdef get_video_details(youtube, video_ids): all_video_stats = [] for i in range(0, len(video_ids), 50): request = youtube.videos().list( part="snippet,statistics", id=','.join(video_ids[i:i+50])) response = request.execute() for video in response['items']: video_stats= dict( Title = video['snippet']['title'], Published_date = video['snippet']['publishedAt'], Views = video['statistics']['viewCount'], Likes = video['statistics']['likeCount'], Comments = video['statistics']['commentCount'] ) all_video_stats.append(video_stats) return all_video_stats
i tried turning "Comments" into and if than statement and i tried turning it into a try/except statement but i couldn't get them to work while creating video_stats in a dict. I kept getting different syntax errors.