From 4e7b6ef98c5f31dbeed50050254e0cb70fe0d959 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 4 Nov 2020 18:59:53 +0100 Subject: Youtube: fix channels page after lazy fetch --- src/plugins/Youtube.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 2418073..e04c51f 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -468,28 +468,8 @@ namespace QuickMedia { PluginResult YoutubeSearchPage::submit(const std::string &title, const std::string &url, std::vector &result_tabs) { if(strncmp(url.c_str(), "https://www.youtube.com/channel/", 32) == 0) { - std::vector additional_args = { - { "-H", "x-spf-referer: " + url }, - { "-H", "x-youtube-client-name: 1" }, - { "-H", "x-spf-previous: " + url }, - { "-H", "x-youtube-client-version: 2.20200626.03.00" }, - { "-H", "referer: " + url } - }; - - //std::vector cookies = get_cookies(); - //additional_args.insert(additional_args.end(), cookies.begin(), cookies.end()); - - Json::Value json_root; - DownloadResult result = download_json(json_root, url + "/videos?pbj=1", std::move(additional_args), true); - if(result != DownloadResult::OK) return download_result_to_plugin_result(result); - - auto channel_body = create_body(); - std::unordered_set added_videos; - std::string continuation_token; - channel_body->items = parse_channel_videos(json_root, continuation_token, added_videos); - auto channel_page = std::make_unique(program, url, std::move(continuation_token), title); - channel_page->added_videos = std::move(added_videos); - result_tabs.push_back(Tab{std::move(channel_body), std::move(channel_page), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); + // TODO: Make all pages (for all services) lazy fetch in a similar manner! + result_tabs.push_back(Tab{create_body(), std::make_unique(program, url, "", title), create_search_bar("Search...", SEARCH_DELAY_FILTER)}); } else { result_tabs.push_back(Tab{nullptr, std::make_unique(program), nullptr}); } -- cgit v1.2.3