Invalid page token on get_playlist_items(count=None)
See original GitHub issueSometimes by running:
playlist = api.get_playlist_items(playlist_id=playlist_id, count=None)
I get the following exception:
pyyoutube.error.PyYouTubeException: YouTubeException(status_code=400,message=The request specifies an invalid page token.)
I have a script that runs this line of code every 10 minutes and it happens to break at least 4 times per hour. It tries to get data from the same playlist so results should be the same, unless a new video is added to that playlist. Sometimes I get that error, sometimes it works just fine. This issue started to happen a week ago on my end. I never experienced similar issues before.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Error paginating the videos in a playlist using Youtube Data ...
Here is an example for the 4th page of a playlist: ... { "error": { "code": 400, "message": "The request specifies an invalid...
Read more >'400 invalidPageToken' error returned for a valid Next Page ...
Same issue here: URL with a page token sometimes works correctly and sometimes returns an error saying 'The request specifies an invalid page...
Read more >Error: 300 - The next page token is invalid or expired
I'm getting the above error when using the following code. //Call to ge the JSON file that is a list of all the...
Read more >PlaylistItems: list | YouTube Data API - Google Developers
The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and ...
Read more >Solved: Invalid Token: Measure in PowerBI
I'm trying to create a measure to give me a % of assessments that were completed in a given period of time, but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here, my most recent run succeeded for all the cases I posted above.
On my end the issue seems solved since 19:46 CEST, August 17 2021.
I already executed 26 calls of
playlist = api.get_playlist_items(playlist_id=playlist_id, count=None)
without any exception.I think it was a bad response from the YouTube servers and now it has been solved. I will test it (one call every 15 minutes) for some days and mark the issue as closed if it will continue to work as expected.