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

get_video_by_id() errors out if given more than 50 ids (maximum allowed by google)

Open razcore-rad opened this issue 5 years ago • 4 comments

In this case get_video_by_id() should group the ids in groups of 50 and make the necessary calls. For now this just gives an error

razcore-rad avatar Dec 17 '19 15:12 razcore-rad

I guess this error caused by the implicit parameter maxResults, I will check it, and try to do something like group the id list.

MerleLiuKun avatar Dec 17 '19 16:12 MerleLiuKun

Yeah, to make it easier on yourself I think you should let _request return a list or responses too: [Response] because merging the responses gets complicated with the pageInfo and other stuff.

razcore-rad avatar Dec 17 '19 18:12 razcore-rad

This will probably break stuff in other parts of the code, but I think it's easier in the end. You can check what experiment I tried starting from this line: https://github.com/razcore-art/python-youtube/blob/5062b01bd39c3eec202570c3786d14982de07fdb/pyyoutube/api.py#L341. I left you some comments to hopefully make it easier

razcore-rad avatar Dec 17 '19 18:12 razcore-rad

Hey, Thanks, I will think this and try your code today. 😺 . Maybe can provide a common method. Because this may for the other resources. Such as channels and playlists etc.

MerleLiuKun avatar Dec 18 '19 05:12 MerleLiuKun