'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


Solution 1:[1]

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)

Solution 2:[2]

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. Likewise 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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yoan Dinkov
Solution 2 Benjamin Loison