From fc27e590c39e3b309683e275541fd9b3164985dc Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 11 Mar 2022 12:41:16 +0100 Subject: Fix youtube streaming for really long videos I dedicate this one to rat --- src/plugins/Youtube.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 2d92cd8..b3150a3 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -2517,6 +2517,15 @@ R"END( if(!format.isObject()) continue; + if(is_adaptive) { + // TODO: Fix. Some streams use &sq=num instead of index + const Json::Value &index_range_json = format["indexRange"]; + if(index_range_json.isNull()) { + fprintf(stderr, "Ignoring adaptive stream without indexRange\n"); + continue; + } + } + // TODO: Support HDR? const Json::Value &quality_label_json = format["qualityLabel"]; if(quality_label_json.isString() && strstr(quality_label_json.asCString(), "HDR")) continue; -- cgit v1.2.3