Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index out of range error #34

Open
pmpBear opened this issue Oct 9, 2020 · 1 comment
Open

Index out of range error #34

pmpBear opened this issue Oct 9, 2020 · 1 comment

Comments

@pmpBear
Copy link

pmpBear commented Oct 9, 2020

I had a problem with your plugin today.
Suddenly it stopped working returning an error about an index out of range.

I've figured out that the problem is that the YT api value "total results" returns an approximation, therefore you can't use it as the max value of a for loop.

Check the documentation here:
https://developers.google.com/youtube/v3/docs/search/list

In my case I had 13 videos, but the total results value was 14.

So, in your plugin you should replace all the occurrences of jsonData['pageInfo']['totalResults'] with Jason data['items'].length

Hope this helps!

@nitishk72
Copy link
Member

okay I will check it soon
If you could check and send PL then it would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants