Sorting Youtube API result from playlist

后端 未结 4 829
后悔当初
后悔当初 2021-01-04 07:40

I have been struggling with Youtube\'s API v3 now and I can\'t get it work in the way I want. My goal is to load the latest videos from a selected playlist into my website.

4条回答
  •  清酒与你
    2021-01-04 08:20

    The current API doesn't have a sorting option for listing playlist items, but if you are inserting the items programmatically, you can specify the position value when inserting to make new videos appear at the top of the list.

    If it's someone else that is adding the videos, than you'll have to get all pages. Since the playlists are limited to 200 items, this requires 4 requests at most. Not ideal, but it's the only option now.

提交回复
热议问题