Youtube API Error 402: Payment Required - youtube-api

I'm trying to use Youtube API on a dedicated server for the first time but I have this error.
I read the FAQ https://github.com/rg3/youtube-dl/blob/master/README.md#http-error-429-too-many-requests-or-402-payment-required
but as I said I use it for the first time...
So how to "unban" my server IP? I would not be able to do a Captcha since it's a dedicated server and not my bowser.

The answer was that youtube-dl API bloks IPv6 IPs from OVH servers. I had to force the IPv4 and it solved it.

Related

Issues getting Youtube API WordPress plugin Restricted

I’m still having no luck getting this Youtube API Restricted properly.
Every time I try to give it HTTP referrers Restrictions & add the following Website Restrictions:
https://www.ohiocannabis.com
https://www.ohiocannabis.com/*
I then get the following error in my Youtube video player on my website: http://www.ohiocannabis.com/videos
Sorry, there was a YouTube API error: The referrer https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=UUkbzQe9G_drgd3QoLmHZNfw&maxResults=15&key=AIzaSyArOPULA9UG52ZQUO7ddZMxrpC6odiFW4I does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions. Please make sure you performed the steps in this video to create and save a proper server API key.
I've also tried using the IP Restriction, the IP for my website is: 107.154.147.253
But when I use that the player gives me the following error:
Sorry, there was a YouTube API error: The calling IP address 50.116.78.101 does not match the IP restrictions configured on the API key. Please use the API Console to update your key restrictions.
So who/what/where is this “Calling IP” coming from that it would have a much different IP than my website domain?
(I unrestricted it so that my videos populate for now, so you may not see that error message on my Videos page)
Any idea on what I’m doing wrong to get this plugin to Restrict & work properly?
Thank you!!
I've tried adding HTTP Restrictions and also IP Restrictions, both with no luck.
I haven't tried any code yet, not sure what to do.
Sorry, there was a YouTube API error: The referrer https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=UUkbzQe9G_drgd3QoLmHZNfw&maxResults=15&key=AIzaSyArOPULA9UG52ZQUO7ddZMxrpC6odiFW4I does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions. Please make sure you performed the steps in this video to create and save a proper server API key.
Sorry, there was a YouTube API error: The calling IP address 50.116.78.101 does not match the IP restrictions configured on the API key. Please use the API Console to update your key restrictions.
So I think I figured it out, I was adding a double restriction on this API by doing the HTTP and the API Restrictions option at the bottom.
I've removed the HTTP Restriction and just kept the API Restriction enabled to the Youtube Data API v3 and it seems to not be giving me the error any longer and showing all of my videos and google console is showing it is in fact now a Restricted API.
Does this sound like I did it right this time?
Thank you!

App rejected for lack of IPv6, is this a server or app issue?

Apple rejected an app because it didnt work on their IPv6 network. I've managed to test this on my end using an ipv6 only address and can see that the third party API i'm using is unreachable when using an IPv6-only address.
Any time i try to use the API I get the response
A server with the specified hostname could not be found
The same thing happens if I manually go the URL in safari, whereas other IPv6-ready sites like gmail etc work.
So my question is do I need to get the developers of the API I'm querying to update their servers to support IPv6 in order to get this working, or is there something I should be doing on the app side in order to make this work?
There's no need to change any external servers. It's all about the client. If by this "third party API" you mean they have a library which you include into your app, then perhaps they are doing something in their code that is not working correctly; if this is the case, then you need to ask them to fix their client library.

Is there a per-IP-address limit on the Twitter streaming API?

I understand that the Twitter streaming API only allows for a single connection per user account on Twitter. I was wondering if multiple streaming connections from the same IP address are allowed, if each connection has credentials from a different user account? For example, in a scenario where a single server may process tweets for multiple users. Specifically, I am curious about the filtered public streams endpoint.
I have read the following, and cannot locate an answer:
Twitter Streaming API limits?
https://dev.twitter.com/rest/public/rate-limiting
https://dev.twitter.com/streaming/public
Thank you, -Matt
I can confirm that I have three different Twitter API streams in a Node-RED application running on the same IP with no problem. Whenever I make changes or redeploy I do get rate limit errors for the first minute or so, but they go away and do not appear again.
The standard Streaming API supports up to two connections on a single IP. Any more than that will result in the oldest stream being disconnected. The developer agreement and policy states that you should not use multiple application keys and/or IP addresses to circumvent this limitation.
Note that it is on the roadmap for the standard filter and sample streams to eventually be updated with new versions, but it is not yet clear if they will carry the same connection limitations.

Does Twilio HTTP requests support the SSL configuration of Universal SSL - which uses SNI and ECDSA?

I have set up an API endpoint on my Digital Ocean VPS to receive incoming SMS to my Twilio number. It was working.
Then I started using CloudFlare. I believe that it stopped working after that, but since I receive SMS so infrequently, I am not absolutely sure. Although Twilio's website indicates that they sent an HTTP request and received a 502 Bad Gateway error, my server logs never registered any incoming requests from Twilio. I know that my API endpoint works because when I manually enter the API endpoint in my Chrome browser, my server receives it and logs the GET request as expected.
I tried asking Twilio's support for the full details of the supposedly failed request, but they refuse to give it to me.
Does anyone know which setting in CloudFlare to adjust that may fix this? I've tried turning off and reducing all the security settings as I thought it may be a firewall issue. How else can I go about debugging this problem without turning off CloudFlare completely (I need it on for other purposes)? I will accept the first answer or advice that leads to the solution. Thanks!
EDIT: this is the response from CloudFlare
One thing to ask them, is whether they support the SSL configuration
of Universal SSL - which uses SNI and ECDSA. We have seen instances of
3rd party services not supporting one or both of these, and therefore
failing to make calls via HTTPS.
Universal SSL support is defined by the client machine's support for
two newer features:
Server Name Indication (SNI) Elliptic Curve certificates (ECDSA) What
browsers work with Universal SSL?
If you need broader browser compatibility for older browsers/operating
systems, our Pro plan plan provides this.
Also, if you want to get full information about what your browser
supports, this site will run a check on your browser and tell you the
support your browser has for protocols, ciphers and SNI:
https://cc.dcsec.uni-hannover.de/
Twilio developer evangelist here.
Good news, Twilio now supports SNI! So, this should no longer be a problem.
You might want to check Server Name Indication (SNI) Twilio does not support this, so as a result you get 502 Bad Gateway. Same thing was happening to me. I was able to fix this using Cloud flare Pro see this post
Twilio - TwiML with SNI Support

How to find the list of dynamic IP Addresses for the outbound connection to Twilio?

Our firewall restricts outbound network connections. Hence we need to know the list of IP addresses to which we need to open up the port for outbound network connections that connects to Twilio for the REST API for sending sms.
How to find out what are the list of IP addresses that twilio uses for outbound connections so that we can open those in our firewall?
As per the Twilio docs it says we need to open up for https://api.twilio.com.
Unfortunately our firewall needs to define a list of IP addresses instead of a URL and it looks like the IP Addresses keep changing and is not static.
Does the following hold good for outbound connections from Twilio for Messages via their REST API?
https://forums.aws.amazon.com/ann.jspa?annID=1701
Please advise.
From the FAQ article on this topic:
Twilio makes HTTP requests to your server to fetch your app’s TwiML instructions. Some users prefer to know which IP address the request from Twilio is coming from in order to open up specific ports in a firewall. However, due to the fluid nature of our cloud architecture, we don’t have a set range of IPs that requests are sent from or know in advance what they will be.
Because Twilio’s requests will be coming from different IP addresses, we instead recommend that you validate that a request came from Twilio by other means. Please see our documentation on securing your application for more details.
If the inability to have a request come from a static IP address is a serious concern, please contact our sales department to discuss other options which might be available.

Resources