-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YouTube Bridge] - YouTube failed with error 0 #2947
Comments
Looks like intermittent network failure. But if you are persistently getting this error it's concerning. Are you sure it's persistent? Is it your private instance? I am not getting this error on my instance. |
I started noticing a couple of days ago. Since then, every single update has the same output. |
What's the server OS and php version? |
LiteSpeed V8.0.1 Cloudlinux 1.3 |
I don't fully understand this errror yet. Maybe the most recent php/curl uses HTTP 2 by default or something. Maybe try this patch if you are able to edit the files: diff --git a/lib/contents.php b/lib/contents.php
index 94e45b95..6a146c68 100644
--- a/lib/contents.php
+++ b/lib/contents.php
@@ -181,6 +181,7 @@ function _http_request(string $url, array $config = []): array
curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
+ curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
if ($config['proxy']) {
curl_setopt($ch, CURLOPT_PROXY, $config['proxy']);
} |
I added the line to contents.php but there were no differences in the output |
Might be a cached result you are seeing. Wait a bit (3 hours) or enable debugging with |
You were absolutely right. I enabled debugging and it is now working as expected (so far, fingers crossed). |
So looks like recent version of libcurl uses HTTP 2 by default instead of HTTP 1.1. I'm not familiar with HTTP 2 and I still don't understand why the error. But I guess we can merge this change into master to preserve the usage of HTTP 1.1. |
I was unable to reproduce this on Debian 11, PHP 8.1.8. Maybe it was a youtube intermittent error? |
Should I un-apply your patch and see if the error occurs? |
Sure :) |
I removed the patch and the bridge does not work for me. |
My install has libcurl |
cURL Information: 7.84.0 |
Since curl 7.62.0 the default option is: CURL_HTTP_VERSION_2TLS Before that the default used to be: CURL_HTTP_VERSION_1_1 Fix #2947
I am having the following issue with Youtube bridge for a couple of days.
Please let me know if you need additional information
Error_log is full of:
[01-Aug-2022 09:43:37 UTC] HttpException: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) (92) in /home/diludovi/public_html/bridge/lib/contents.php:230
Stack trace:
#0 /home/diludovi/public_html/bridge/lib/contents.php(107): _http_request('https://www.you...', Array)
#1 /home/diludovi/public_html/bridge/lib/contents.php(284): getContents('https://www.you...', Array, Array)
#2 /home/diludovi/public_html/bridge/bridges/YoutubeBridge.php(227): getSimpleHTMLDOM('https://www.you...', Array, Array, true, true, 'UTF-8', false, '\r\n', ' ')
#3 /home/diludovi/public_html/bridge/bridges/YoutubeBridge.php(342): YoutubeBridge->ytGetSimpleHTMLDOM('https://www.you...')
#4 /home/diludovi/public_html/bridge/actions/DisplayAction.php(136): YoutubeBridge->collectData()
#5 /home/diludovi/public_html/bridge/index.php(32): DisplayAction->execute(Array)
#6 {main}
The text was updated successfully, but these errors were encountered: