Expected delay for youtube feeds? - youtube

We switched over to YouTube from a previously developed internal video system, and right now I've got it going on public upload feeds for users. The problem comes when we first got only about a dozen out of 150 or so videos available from the primary user's account. Over time of the day that number rose to about 50, and its stayed there. I found one post on the YouTube API forums about delay, but no word on how long I can expect that.
Anyone have experience about this to tell me what to expect?

Expected latencies can vary, and are documented here (http://code.google.com/apis/youtube/2.0/reference.html) - ways you can minimize it:
1) Upload the video as public. If you upload the video as private first, this will leave the video out of the fast-track indexing
2) Make an authenticated request to the user feed, this will guarantee the freshest data that the API has.
ie. http://gdata.youtube.com/api/feeds/users/username/uploads (with a dev key and auth token for 'username') instead of http://gdata.youtube.com/api/feeds/videos?author=username

Related

How to increase video upload quota on Youtube API?

We are a UA agency and we are building an internal tool to automatically upload videos on YouTube in order to then use these videos in our Google Ads App Campaigns. However, we are currently limited to uploading 6 videos through YouTube API per day which is way too low compared to our needs. We followed the process to request a quota increase. However, we can't go through as our system is internal so Google can't check its use or purpose. We would like to get in touch with someone to whom we can explain the issue.
Cheers,
Matthieu
By default, YouTube allows video uploads that are up to 15 minutes long. If you try to upload videos longer than 15 minutes, the upload will fail. This is a YouTube limitation rather than a Brightcove limitation.
To upload longer videos to YouTube, you need to verify your account with YouTube:
Open the YouTube upload page at https://www.youtube.com/upload.
Click Increase your limit link at the bottom of the page.
Note: If you can't find the Increase your limit link, it's possible that you may already be able to upload long videos. Check the Longer videos section in your YouTube Account Features page to check if the feature has already been enabled.
Follow the steps to verify your account with a mobile phone.
When you receive a text message from YouTube in response, enter the verification code from the text message and click Submit.
YouTube will then confirm when your YouTube account has been activated for longer uploads. From this point, any videos longer than 15 minutes in your Video Cloud account will be synced to YouTube.
You'll need to apply for a quota extension, you can do so here: https://support.google.com/youtube/contact/yt_api_form?hl=en

YouTube DataApi v3 subscription limitations

I am using https://developers.google.com/youtube/v3/guides/push_notifications to continually monitor ~ 2,000 channels for new videos etc.
Up until last week, I wasn't having any problems, with pubnubsubbub, however, for some reason, I am getting 403 when I am trying to access (via curl or requests) https://pubsubhubbub.appspot.com/subscribe saying nothing more than
<p>
<b>403.</b> <ins>That’s an error.</ins>
<p>Your client does not have permission to get URL <code>/subscribe</code> from this server. <ins>That’s all we know.</ins>
</p>
So my questions are:
is there any limit (either IP or time or quota) that is documented somewhere and I am somehow hitting? As xml calls were "unlimited" and i do not see any difference in the official YouTube Data Api documentation
have somebody found a better pub/sub channel (either paid or not) with YouTube DataApi 3
if somebody had a similar situation, how long my "ban" will stay
As suggested by Marco Aurelio, I am adding my solution.
My VPS provider had some bans from Google on their IPv6 network in the data center where I had my server running. Thus by contacting them and fixing my network settings the pubsubhubbub continued working without issues.
So the tip for future debuggers stumbling upon here is trying to curl any other Google API (e.g. a function) that you are 100% sure it works and if you are still getting 403, then your IP address range is blocked for some reason (like data center ban in my case).
If you continue to have the problem and getting the "notification" with a maximum delay of 6 minutes isn't a problem, here is a workaround.
I don't use pubsubhubbub but you can simulate its advantages. Indeed you have 10 000 quota a day, using PlaylistItems: list with the uploads playlist of the channel found with contentDetails in part by using Channels: list.
In that way you can check for new videos for 50 YouTube channels for 1 quota so if you want to check your 2 000 channels you have to spend 40 of quota.
If you want to uniformly check during the day you can so make 250 global checks a day, so every 346 seconds (almost 6 minutes).
Of course you have to store your last videos found for a YouTube channel in order to check if there is any difference during your new global check.
If you just want a boolean response whether or not your current request response is different from the previous one, you can check the etag.

Can I get a YouTube user's session data from the YouTube API?

I am a teacher and I have a YouTube channel with videos for my students. Every time one of my students see a video, I would love to know how he interacted with it: where he has paused it , where he has rewinded it, etc. This would help me in knowing the parts of the video that are difficult to understand.
My question is: is it possible to get all this data from a user's session? Specifically, can I get these detailed raw data from YouTube APIs?
From what I have explored so far, it seems that it is not possible, as YouTube APIs only seem to send "aggregated" data (example: total number of views of a video) or "properties" (example: title of the video).
I would really just need a Yes/No answer to my question, just to know if I am not waisting my time in exploring the APIs as a solution to my problem.
Thank you.
Yes and no,
But here is a more detailed explanation.
The YouTube Analytics api will give you analytics data on your own YouTube channel, but it wont be user specific you cant track who exactly did something. You may however be able to get some basic information about each video and what was clicked and how much was viewed. video reports But its not going to be user specific you wont know what Mike did as opposed to what Jane did.
The YouTube Data api will allow you to manage your own YouTube Channel for example upload videos and see subscriptions. It will also let you search for public videos on YouTube.
If you do want user specific then What you are looking for is session data related to user activity. Something like this is not publicly available. Google couldn't share your students activity without the students permission due to GDPR not to mention the fact that tracking anyone under the age of 13 would also be against some GDPR laws if i remember correctly.
Even Google analytics doesn't offer websites a decent way of tracking individual users activity on their websites. You can do it but you have to add additional tracking data to your website, and notify users that you are doing it.
SO your answer is yes kind of

How can I get the status of a user's stream?

I'm building a thing that tells people when a YouTube stream goes live. In order to build this, I need to know when a stream goes live, be it via push notification, polling, or some other method.
With Twitch, it's dead easy. All you have to do is send a GET to https://api.twitch.tv/kraken/streams/[STREAMER_USERNAME_HERE] and you get a JSON object with everything you'd ever hope to know (try it in your browser, it's great). I have combed through the YouTube Streaming and Data API's and nothing even close to this feature seems to exist.
I know that something, somewhere is alerting something when a stream goes live, because my phone gets a notification when the people I am subscribed to start streaming. But if there are no public calls in the API, I'm left with no other option than scraping the HTML off a page every couple seconds, which is bad for both me and YouTube.
Further on this, YouTube's push notification API for regular videos famously doesn't work [1] [2] [3] [4], and every dev is left to either use the deprecated XML feeds (which update sometimes up to an hour slow) or scrape HTML off youtube.com pages (the only current solution for instant updates). So, even if there's something off the API that I missed, it's moot if it doesn't actually work.
That said, am I missing something? Is it possible to get a notification if a stream goes live? It's kind of a deal-breaker for YouTube vs Twitch if there isn't.
It is currently not possible to do what you are asking with the public YouTube API.
You can only retrieve information about your own liveStream or liveBroadcast objects, not anyone else's. Additionally, there is no public API to get a notification when another user goes live.

Upload video to Youtube without user autentication

I'm building an iPad app (which is actually going to be part of a promotional kiosk), which lets whoever wants, to record a video (at the place, using the iPad), in order to get a chance to win a prize.
But I just realized that the Youtube API seems to have changed and now it requires user authentication in order to upload the video - which can't be done in my case.
Has anyone faced this problem before? Has anyone found an alternative to uploading the video from the iOS app directly to a specific Youtube account (which I've got full control of) without requiring user's authentication?
Help is highly appreciated!
For privacy issues, users have to upload videos into their accounts first. There is one way to get around it.
You can use YouTube Direct Lite.
So user's would still upload their videos with their own credentials, but then you have the option to moderate and approve those videos to have them in your playlist.
Otherwise if you try to login with only one account and upload all videos there, you will hit limits really soon.

Resources