aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-03 09:01:14 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-03 10:42:30 +0200
commitbe20a78ab01b924fc1261ff3c71361feb440e592 (patch)
treef4c54eac158ee92b5dca42d6967fa1b2b5135cde /src/QuickMedia.cpp
parent522c6ea14cd2c1569ce5ff24c0241edba1835308 (diff)
xv: fix missing search results, incorrect title to thumbnail matches
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp10
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;