bhaskar
bhaskar

Reputation: 1080

Exclude all videos in youtube api playlist which says "The video is not available"

I am using the foloowing api for fetching the playlist of youtube channel: https://www.googleapis.com/youtube/v3/playlistItems?key=*********************&playlistId=PLtS_xRaINoXVqR9JTzwkcMLaOIq0uj831&part=snippet,contentDetails&format=6&maxResults=50&fields=items

some of the videos is not available so how can i exclude those videos ?

Upvotes: 1

Views: 610

Answers (1)

Nick Cardoso
Nick Cardoso

Reputation: 21733

As per the Developers Guide by including a region (where you are) you can avoid "not available in your region" errors.

 &regionCode=es

Changing the format type to 5 (API v2) or checking status.Embeddablè (API v3) will avoid those videos where embedding is disabled.

Other causes are when the Video is recently uploaded. In this case you should first do a check with the Video Status API

Upvotes: 1

Related Questions