dunkyl / SlyYTDAPI-Python

No-boilerplate, async YouTube Data API access. 😋
MIT License
3 stars 1 forks source link

400: The request specifies an invalid filter parameter. #10

Open betterthanever2 opened 1 month ago

betterthanever2 commented 1 month ago

I'm getting a 400 error when running consecutively get_playlist_videos and videos methods, like so:

uploads = await self.ytb_api.get_playlist_videos(playlist_id=self.channel.uploads_playlist_id, limit=100)
raw_videos = await self.ytb_api.videos([u.id for u in uploads], parts=Part.ALL_PUBLIC())

Complete error message:

Status: 400
Reason: {
  "error": {
    "code": 400,
    "message": "The request specifies an invalid filter parameter.",
    "errors": [
      {
        "message": "The request specifies an invalid filter parameter.",
        "domain": "youtube.parameter",
        "reason": "invalidFilters",
        "location": "parameters.",
        "locationType": "other"
      }
    ]
  }
}
dunkyl commented 1 month ago

I looked into it. Turns out that the objects returned from a playlist have a distinct ID from the video, and a few other small differences. A new version has been published that will ask for and set id to the video ID for playlist items, which should fix the issue in this case.

betterthanever2 commented 1 month ago

Thank you for your prompt responses!

betterthanever2 commented 1 month ago

Still getting this error, though

dunkyl commented 1 month ago

Is the playlist longer than 50 videos? It appears that this also gives an error. I have added logic to batch videos into groups of 50 for this method and published it.