diff options
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r-- | src/QuickMedia.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index e63a5f2..b431532 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -879,8 +879,8 @@ namespace QuickMedia { static void add_xvideos_handlers(MediaGenericSearchPage *media_generic_search_page) { media_generic_search_page->search_handler("https://www.xvideos.com/?k=%s&p=%p", 0) - .text_handler({{"//div[id='content']//div[class='thumb-under']//a", "title", "href", "/video"}}) - .thumbnail_handler({{"//div[id='content']//div[class='thumb']//img", "data-src", "/videos/"}}) + .text_handler({{"//div[id='main']//div[class='thumb-under']//a", "title", "href", "/video"}}) + .thumbnail_handler({{"//div[id='main']//div[class='thumb']//img", "data-src", "/videos"}}) .related_media_custom_handler([](const std::string &html_source) { std::vector<MediaRelatedItem> related_items; size_t related_start = html_source.find("video_related=["); @@ -1245,7 +1245,11 @@ namespace QuickMedia { use_youtube_dl = true; } else if(strcmp(plugin_name, "xvideos") == 0) { check_youtube_dl_installed(plugin_name); - auto search_page = std::make_unique<MediaGenericSearchPage>(this, "https://www.xvideos.com/", sf::Vector2i(352/1.5f, 198/1.5f), false); + + std::vector<CommandArg> extra_commands = { + { "-H", "Cookie: last_views=%5B%2236247565-" + std::to_string(time(nullptr)) + "%22%5D" } + }; + auto search_page = std::make_unique<MediaGenericSearchPage>(this, "https://www.xvideos.com/", sf::Vector2i(352/1.5f, 198/1.5f), false, std::move(extra_commands)); add_xvideos_handlers(search_page.get()); tabs.push_back(Tab{create_body(false, true), std::move(search_page), create_search_bar("Search...", 500)}); use_youtube_dl = true; |