Determine if a video is restricted to Premium Music members via the api - youtube-data-api

I host a wiki with many YouTube links and have a script that checks them all regularly to make sure they still exist and are not blocked (by region). I'd like to also check for videos that are inaccessible due to requiring Premium Music membership, but I cannot find that data point in the API documentation.
Example of a restricted Premium Video: https://www.youtube.com/watch?v=NCRnj62bFOY
Thanks for any guidance.

As said #stvar it doesn't seem that any YouTube Data API v3 endpoint meets your needs. However you can bypass the need of the YouTube Data API by downloading the webpage https://www.youtube.com/watch?v=NCRnj62bFOY and checking whether or not this one contains "Music Premium". If so it is a Music Premium limited video.

Related

Overly broad permission ask for google youtube API

I'm using the YouTube API to create a webpage that allows users to view a specific set of YouTube videos, and then LIKE those videos, using YouTube like/dislike rating system, and It's working fine, but when the user triggers the process, after logging into their google account, they are presented with a permission dialog that basically says
"Hey, this site wants complete and total control over your YouTube account!".
I DO NOT want that, I only want the user to be able to rate the videos.
I'm using the PHP Client library to pull the list of videos into the page and display them, and this requires no permissions or interaction from the user. I am also using the JS library to handle the "like" functionality, and it's basically the javascript example from https://developers.google.com/youtube/v3/docs/videos/rate?apix=true, but with my credentials.
Can I change this somewhere, or does YouTube just lump all of it's permissions under one giant "I can do anything" permission group?
I figured it out. It's about the OAuth 2 scopes, which the example lets you change for the DEMO, but it doesn't actually change the code in the sample.
For reference, the list of scopes is here: https://developers.google.com/identity/protocols/googlescopes#youtubev3

Extending YouTube API Quota with limited funds

With a simple java program, I send GET requests using YouTube Data API specifically videos.list, in order to get the public metadata of a video and store it as .json files.
For my universities research, we have to do this with all available YouTube video IDs provided in the Youtube-8M Database.
Therefore, I would like to know if there is a way to extend the available quota for requests (I already know about the billing option, but I am a student and my university is small).
I have read the YouTube API terms, which states that only one project per client may be used to send such requests with the necessary API Key.
If I understand it correctly, even my simple java code is such a client.
In some other Stack Overflow questions about extending ones daily quota with API Keys, some suggested creating multiple accounts or projects.
Is this a legal option or not? Or is there another possibility to get a higher quota for simple requests used in research like I do right now?
If you go to the Google Developer console where you enabled the YouTube API. the second tab is called quota
Click the pencil next to which ever quota it is that you are blowing out. A new window will pop up with a link called apply for higher quota.
Fill out the form to apply. To my knowledge you do not have to pay for additional YouTube quota but it can take time to get approved. Make sure you comply with everything on the form.
I have never heard of the one project per client term. Technically you can run your application using different API Keys it should work fine. Technically there is nothing wrong with creating additional projects on Google Developer console. You don't need to go as far as creating another Google account.

How to detect restricted youtube videos via the api?

How can I use the youtube api to determine if a video is blocked for students in restricted mode? I have looked through quite a few resources and they all seem like outdated or inaccurate responses. When I go to https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=IERz1PmkdC4&key={myAPIKey} I get contentDetails but it does not include "contentRating": { "ytRating": "ytAgeRestricted"} even though I know this video is blocked for students in restricted mode.
Is this the wrong api to determine restriction information on a video? Or do I need to be the owner of the video to fetch this info? Or is it no longer possible to get this info via this api?
Currently I have found that I can use a call to https://www.youtube.com/get_video_info?html5=1&video_id=IERz1PmkdC4 when logged in as a student in restricted mode, this will return an error but unrestricted videos will not return an error. But this is an unsupported solution that I would rather avoid.
Resources I have already looked at:
The V3 API documentation - https://developers.google.com/youtube/v3/docs/videos#properties
There is a question here in stack overflow that seems to have an inaccurate response -
Checking if video is age restricted with v3 of YouTube API
An untagged question with no response - http://stackoverflow.hex1.ru/questions/35120259/how-can-i-tell-if-a-youtube-video-cannot-be-viewed-with-restricted-mode-enabled
This didn't help - How do I check if a youtube video is blocked/restricted/deleted

Uploading video to Youtube to a master account

I need to have people sending videos directly to my customer's Youtube account.
My customer doesn't want to have people login with their own Youtube account. This has to be transparent for people so they are not forced to have a Youtube account to send videos.
I found several solutions like Youtube Direct lite or the Youtube Widget but this is not exactly what they need as it force them to log to their own account... Same with Youtube API and OAuth2...
Is there any solution with the YouTube Data API v3 even if this is not really "best practice"
?
(I'm using PHP on Codeigniter)
Best regards.
I've just done a search on Google and found
http://tuts.stackarena.com/2013/03/uploading-videos-to-youtube-from-your-website-in-php/
It may also be worth checking out https://developers.google.com/youtube/ for additional resources, usually you find Google will have a solution for your needs.
Good luck

lighttpd proxy server for school

I am developing a video hosting site for use by teachers to distribute instructional screencast videos to their students. I http pseudo stream flv files from a lighttpd server to embedded JW Players. All is working well with that. I also allow my teacher to embed selected YouTube content in their playerlists. Right now the JW Player just calls the videos directly from YouTube using the YouTube API. That works well too. The issue is when kids try to watch YouTube videos at school, the school’s filter blocks all YouTube content. My teacher’s have asked me to look into using my lighttph server as a proxy server for youtube to get around the filter.
I have zero experience with proxies. I think I should be able to use the proxy module in lighttpd to make youtube.com “look like” mydomain.com to the school’s filter, I just don’t really know where to start. The other complication is that when the player calls a YouTube video, it get’s redirected to lots of other URLs some youtube.com and some other domains. Those all also need to be handled by the proxy.
Can anyone provide any insight or advise? Is what I am trying to do reasonable? Can anyone provide any lighttpd configuration code examples that might jump start me? Thanks very much! I appreciate any and all suggestions.
Thanks much for your advice! I think I may need to clarify what I am trying to do.
The server that would be used as the proxy is outside the school’s network and it is unfiltered by the school. Its domain is “approved” for students use. I can download youtube to the server and stream for there. That does work and we do it. I would like to save disk space on the server by having it proxy youtube and deliver it to the school’s network “labeled” as coming from its own approved domain. Since I can already control the use of that domain, I will be able to control the youtube content that students can access with it. The idea is to give teachers the ability to selectively grant student access around the filter.
This is a huge limitation that teachers in many school districts face. Youtube has a tremendous amount of content that we could and should be using with our kids, but because there is also “inappropriate” content there, most school districts simply filter out all youtube access.
safest solution would be to download the youtube videos to your local network, and link&stream them from inside your own network. Otherwise you would have to allow your proxy server youtube access at your school’s filter, however this won't bring you closer to your goal because then everyone at school could just watch youtube via your proxy.
I never used lighthttpd as a proxy, but WinGate7 (beta3) could handle this, let's you set up whitelists (for your allowed youtube video url's) groups etc. This is not a free product, but you can get a discount for schools and universities.

Resources