For some videos, YouTube site would say, Video not available in my country.
Is it possible to check using YouTube data APIs or some other way, which country this particular video is allowed ?
This site will provide information about the countries the video is restricted.
https://polsy.org.uk/stuff/ytrestrict.cgi
Check this link. You can use the contentDetails.regionRestriction property of the video.
Example : https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=tDDAa1If-u4&key={YOUR_API_KEY}
Related
Whether it possible to create podcast RSS from YouTube channel?
Does YouTube have some API for this?
Also whether it possible to get audio from specific YouTube video?
I dont believe so, but Google does have documentation for the Youtube API.
I did not find much in the docs about just interacting with the audio, but here's the docs commmon use cases: https://developers.google.com/youtube/v3/code_samples/code_snippets
So I got the new API cURL working for me for requesting video informations, I want to get the "licensed" info, tried with a music video, it worked, here.
My problem here is that I even tried it with a normal video, I got the same "licensedContent": true How can I detect if the music video is actually licensed?
For an example here is shakira's song and the description of the license here.
Disclaimer:
The following answer isn't complying with the YouTube operational API specification, you should instead follow my other StackOverflow answer on enumerating the musics in the given video. That way by checking whether or not the video contains musics you can deduce if the video is licensed or not.
Deprecated answer:
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to use my open-source YouTube operational API. Indeed by requesting https://yt.lemnoslife.com/videos?part=containsMusic&id=VIDEO_ID you'll get the boolean whether or not the video contains a music in item["containsMusic"].
Examples:
Hips don't lie:
https://yt.lemnoslife.com/videos?part=containsMusic&id=DUT5rEU6pqM
(returning "containsMusic": true)
A not music
video:
https://yt.lemnoslife.com/videos?part=containsMusic&id=6ZRgVX8SYX4
(returning "containsMusic": false)
licensedContent
means that the content was uploaded to a channel linked to a YouTube content partner and then claimed by that partner.
https://developers.google.com/youtube/v3/docs/videos#contentDetails.licensedContent
When a video on Youtube was Includes copyrighted content flag in the video manager. I want get list that videos with some information such as "CONTENT","CLAIMANT","POLICY". What i would like to know is if Youtube's or Google's API can give us this same information?
Thanks,
You can check the contentDetails.licensedContent:
Indicates whether the video represents licensed content, which means that the content was uploaded to a channel linked to a YouTube content partner and then claimed by that partner.
It is also provided in this related SO post, there is also no parameters who the claimant is or policy.
Hope this helps.
Here is a link to video which does not work
https://www.youtube.com/watch?v=abEOkul6HEx
How I can programatically detect this ?
The scenario would be to monitor a list of youtube videos and detect if a single video was deleted or is no longer available
Any ideas ?
You can use following youtube v3 API GET request
https://www.googleapis.com/youtube/v3/videos?part=id&id={VIDEO_ID}&key={YOUR_API_KEY}
In the results check for pageInfo.totalResults attribute
Update
If you want to pass multiple video ids in one API, it also can. id={VIDEO_ID1},{VIDEO_ID2}. In this case you can't depend on pageInfo.totalResults you have to go through items[].id decide.
I basically want to make a video "private", but then use some code to display it public on my site. Is that possible?
It seems like "unlisted" is what I want. According to this article:
An unlisted video is a different type of private video. "Unlisted" means that only people who know the link to the video can view it (such as friends or family to whom you send the link). An unlisted video will not appear in any of YouTube's public spaces (such as search results, your channel, or the Browse page). An unlisted video is different to a private video in these ways: you don't need a YouTube account to watch the video (you can see an unlisted video if someone sends you the video's link) there's no 25 person sharing limit
Still not sure if this is really going to help me keep prying eyes away from the video, but for now, it seems to do what I want.