Originally Posted by chiman
How can we know if Youtube has blocked our server's IP address?
Is it by getting a "Connection timed out", means our server's IP has been blocked?
A "Connection timed out" response means the connection timed out. There are many reasons that you might receive this message. One of those reasons could be because your IP is blocked. But you need to eliminate all other possible reasons before you can conclude that this 100% means YouTube has blocked your IP.
What you might do is:
1) Send a regular cURL request
to a page hosted on another server (not a YouTube page).
2) Send another "regular" cURL request to a YouTube video page
3) Send a cURL request to the same YouTube video page
, but change the outgoing IP address via CURLOPT_INTERFACE or CURLOPT_PROXY
. (The IP you use should not be a shared IP, and should not otherwise have been used to connect to YouTube in the past.)
4) Repeat steps #1-3 a few times
If you are consistently unable to connect via #2 but can connect via #1 and #3, then you could make a case that your regular server IP is banned or blocked by YouTube.