Reputation: 357
I am looking to find out wether a video on youtube is blocked (in germany) because its GEMA protected. Ideally via the youtube API. I would like to know if its protected before the player tells me so. An example for an video which is GEMA protected (the protection only occurs with german ip): https://www.youtube.com/watch?v=BgfcToAjfdc
Upvotes: 3
Views: 608
Reputation: 2362
You can check this in an HTTP request by using search.list and specifying part=contentDetails
. contentDetails has a blocked section that gives you the region code of any countries where the video is blocked.
For example, for this video, you would call:
https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=BgfcToAjfdc&key=[API_KEY]
And you get:
{
"kind": "youtube#videoListResponse",
"etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/wC5hYBNHuSGatyO7FsTaHrWY5HI\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/4dW1h00OUpXXhtaz2M71v9cXGsQ\"",
"id": "BgfcToAjfdc",
"contentDetails": {
"duration": "PT5M26S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": false,
"regionRestriction": {
"blocked": [
"DE"
]
You can see in the blocked
section that the video is blocked in Germany.
Upvotes: 4