From fc632e90d793babc47044ff87ab63a86211e0bd0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 13 Apr 2021 08:09:33 +0200 Subject: Fix youtube comments --- src/plugins/Youtube.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 3813068..4add02c 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -337,6 +337,17 @@ namespace QuickMedia { cookies_filepath = filename; atexit(remove_cookies_file_at_exit); + + std::vector additional_args = { + CommandArg{ "-b", cookies_filepath }, + CommandArg{ "-c", cookies_filepath } + }; + + // TODO: Is there any way to bypass this? this is needed to set VISITOR_INFO1_LIVE which is required to read comments + std::string response; + DownloadResult result = download_to_string("https://youtube.com/subscription_manager?disable_polymer=1", response, std::move(additional_args), true); + if(result != DownloadResult::OK) + fprintf(stderr, "Failed to fetch cookies to view youtube comments\n"); } return { -- cgit v1.2.3