From 27a79a205f865a4023d8e78d0699cc12f2f707cf Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 9 Aug 2021 19:00:59 +0200 Subject: Disable media proxy curl buffering --- src/plugins/youtube/YoutubeMediaProxy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/youtube/YoutubeMediaProxy.cpp b/src/plugins/youtube/YoutubeMediaProxy.cpp index c1c3c0b..61eb374 100644 --- a/src/plugins/youtube/YoutubeMediaProxy.cpp +++ b/src/plugins/youtube/YoutubeMediaProxy.cpp @@ -20,7 +20,7 @@ namespace QuickMedia { static const int MAX_BUFFER_SIZE = 65536; static const int64_t RANGE = 524287; static const int64_t THROTTLED_DOWNLOAD_LIMIT_KB = 80; // TODO: What about people with really slow internet? What if the video player cache is not working and download is stuck, leading to false download speed calculation? - static const int64_t THROTTLED_DURATION_SECS = 2; + static const int64_t THROTTLED_DURATION_SECS = 3; static const char download_error_response_msg[] = "HTTP/1.1 500 Internal Server Error\r\n" "Content-Length: 0\r\n\r\n"; @@ -40,6 +40,7 @@ namespace QuickMedia { std::string url = media_url + "&rn=" + std::to_string(rn) + "&rbuf=" + std::to_string(rbuf); std::vector args = { "curl", //"-H", "Accept-Language: en-US,en;q=0.5", "-H", "Connection: keep-alive", + "--no-buffer", "-H", "user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36", "-g", "-s", "-L", "-f" }; -- cgit v1.2.3