I have a list of 2055 different video IDs (video_ids). I am trying to pull details (likes, views, etc.) from each of these videos and add them to a dictionary.
all_video_data = []request = youtube.videos().list( part="snippet,contentDetails,statistics", id=video_ids )response = request.execute()for video in response['items']: data_keep = {'snippet': ['channelTitle', 'title', 'publishedAt'],'statistics': ['viewCount', 'likeCount', 'commentCount'],'contentDetails': ['duration'] } video_data = {} video_data['video_id'] = video['id'] for k in data_keep.keys(): for v in data_keep[k]: video_data[v] = video[k][v] all_video_data.append(video_data)The error I'm getting is because of my request block. The limit of videos per request is 50, so it makes sense when I try to do 2055. Should I be looping a request for each video id? Should I loop a request for each 50 IDs?
Tried smaller data sets of less than 50, worked. Not sure how to loop a request for every 50 and append.