Videos that are not playable will normally have app$control
elements set in their JSON response when retrieved using v2 of the Data API. Here's an example of what to look for in your response JSON:
"app$control": {
"app$draft": {
"$t": "yes"
},
"yt$state": {
"$t": "This video is not available in your region.",
"name": "restricted",
"reasonCode": "requesterRegion"
}
}
There are other reasons why a video might not be playable in a given playback scenario, so the absence of app$control
doesn't ensure that the video can always be played. But if app$control
is there, then the video can't be played.