#3163 - Youtube API
| Identifier | #3163 |
|---|---|
| Issue type | Major issue (breaks an entire feature) |
| Title | Youtube API |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | galleries |
| Description | I am running the final version 10.
I have setup the youtube api etc correctly, however upon clicking allow for managing my youtube acct I get the following error. Cannot connect to the server in the URL, https://accounts.google.com/o/oauth2/token; the “file_get_contents(https://216.58.220.13/o/oauth2/token) [<a href='http://php.net/manual/en/function.file-get-contents.php'>function.file-get-contents.php</a>]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found ” error was received. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
That said, I believe you're not running the PHP cURL extension. If you can get that installed I do advise it. Currently Composr is having to fall back to the PHP streams downloader, which is the worst one.
cURL support enabled
cURL Information 7.36.0
Still getting the same error.
:var_dump(curl_version());
array(9) {
["version_number"]=>
int(467968)
["age"]=>
int(3)
["features"]=>
int(34493)
["ssl_version_number"]=>
int(0)
["version"]=>
string(6) "7.36.0"
["host"]=>
string(23) "x86_64-redhat-linux-gnu"
["ssl_version"]=>
string(14) "OpenSSL/1.0.1e"
["libz_version"]=>
string(5) "1.2.3"
["protocols"]=>
array(20) {
[0]=>
string(4) "dict"
[1]=>
string(4) "file"
[2]=>
string(3) "ftp"
[3]=>
string(4) "ftps"
[4]=>
string(6) "gopher"
[5]=>
string(4) "http"
[6]=>
string(5) "https"
[7]=>
string(4) "imap"
[8]=>
string(5) "imaps"
[9]=>
string(4) "ldap"
[10]=>
string(5) "ldaps"
[11]=>
string(4) "pop3"
[12]=>
string(5) "pop3s"
[13]=>
string(4) "rtsp"
[14]=>
string(3) "scp"
[15]=>
string(4) "sftp"
[16]=>
string(4) "smtp"
[17]=>
string(5) "smtps"
[18]=>
string(6) "telnet"
[19]=>
string(4) "tftp"
}
}
As an unrelated note, I saw that the config option descriptions no longer related to how you set up Google Keys with Google. Updated...
This is the oAuth “Client ID”:
Set up for a project on the Google API console.
Enable the Youtube Data API on the project from Library (open it and Enable).
Create an oAuth server key from Credentials (this will get you your “Client ID” and “Client Secret” values.
Make sure you whitelist http://yourbaseurl/adminzone/index.php?page=youtube_oauth as an Authorized Redirect URI).
Add an API key from Credentials (this will get you your “YouTube API key” value).
You will also want to increase your video length limit.
You will then be able to authorise with Youtube from Admin Zone > Setup > YouTube API access.
It's falling back to the stream wrapper HTTPS implementation, which unfortunately I can see had 4 distinct issues...
1) HTTPS stream wrapper errors getting eaten up (stream wrappers have multiple layers of error message, and we were only showing the last)
2) HTTPS broken with stream wrappers due to not passing host header for certification validation. Then if fixed HTTPS broken with stream wrappers anyway due to PHP ignoring host header when validating certificate; we have to use the correct host in the connect URL and bypass our "use local DNS server" feature
3) HTTPS broken with stream wrappers due to not passing in SSL context options properly
4) Fallback after cURL fails is broken, as earlier code customises request for cURL then doesn't rebuild the request
I think honestly the stream wrapper fallback was never tested because it needs the PHP OpenSSL extension to be installed, and on many systems it isn't anyway. Usually cURL is working.
I've reattached sources/files2.php.
It would be a couple of days work to revive it.