aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Mangatown.cpp13
-rw-r--r--src/plugins/NyaaSi.cpp5
-rw-r--r--src/plugins/Plugin.cpp1
-rw-r--r--src/plugins/Pornhub.cpp7
4 files changed, 20 insertions, 6 deletions
diff --git a/src/plugins/Mangatown.cpp b/src/plugins/Mangatown.cpp
index 992e0cc..d9013f7 100644
--- a/src/plugins/Mangatown.cpp
+++ b/src/plugins/Mangatown.cpp
@@ -12,12 +12,13 @@ namespace QuickMedia {
return atoi(str) != 0;
}
- SearchResult MangatownSearchPage::search(const std::string &str, BodyItems &result_items) {
+ static SearchResult search_page(const std::string &str, int page, bool use_tor, BodyItems &result_items) {
std::string url = "https://www.mangatown.com/search?name=";
url += url_param_encode(str);
+ url += "&page=" + std::to_string(page);
std::string website_data;
- if(download_to_string(url, website_data, {}, is_tor_enabled(), true) != DownloadResult::OK)
+ if(download_to_string(url, website_data, {}, use_tor, true) != DownloadResult::OK)
return SearchResult::NET_ERR;
if(website_data.empty())
@@ -59,6 +60,14 @@ namespace QuickMedia {
return SearchResult::OK;
}
+ SearchResult MangatownSearchPage::search(const std::string &str, BodyItems &result_items) {
+ return search_page(str, 1, is_tor_enabled(), result_items);
+ }
+
+ PluginResult MangatownSearchPage::get_page(const std::string &str, int page, BodyItems &result_items) {
+ return search_result_to_plugin_result(search_page(str, 1 + page, is_tor_enabled(), result_items));
+ }
+
PluginResult MangatownSearchPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
BodyItems chapters_items;
diff --git a/src/plugins/NyaaSi.cpp b/src/plugins/NyaaSi.cpp
index 3ae6ffb..fa4e94f 100644
--- a/src/plugins/NyaaSi.cpp
+++ b/src/plugins/NyaaSi.cpp
@@ -39,10 +39,6 @@ namespace QuickMedia {
return body_item;
}
- static PluginResult search_result_to_plugin_result(SearchResult search_result) {
- return (PluginResult)search_result;
- }
-
// TODO: Also show the number of comments for each torrent. TODO: Optimize?
// TODO: Show each field as seperate columns instead of seperating by |
static SearchResult search_page(const std::string &list_url, const std::string &text, int page, bool use_tor, BodyItems &result_items) {
@@ -174,6 +170,7 @@ namespace QuickMedia {
body_item->set_title_color(sf::Color(43, 255, 47));
else if(is_remake)
body_item->set_title_color(sf::Color(255, 45, 47));
+ body_item->thumbnail_size = sf::Vector2i(80, 28);
result_items.push_back(std::move(body_item));
}
diff --git a/src/plugins/Plugin.cpp b/src/plugins/Plugin.cpp
index 0b554ae..a391d06 100644
--- a/src/plugins/Plugin.cpp
+++ b/src/plugins/Plugin.cpp
@@ -5,4 +5,5 @@ namespace QuickMedia {
PluginResult download_result_to_plugin_result(DownloadResult download_result) { return (PluginResult)download_result; }
SearchResult download_result_to_search_result(DownloadResult download_result) { return (SearchResult)download_result; }
ImageResult download_result_to_image_result(DownloadResult download_result) { return (ImageResult)download_result; }
+ PluginResult search_result_to_plugin_result(SearchResult search_result) { return (PluginResult)search_result; }
} \ No newline at end of file
diff --git a/src/plugins/Pornhub.cpp b/src/plugins/Pornhub.cpp
index b063a32..c0e3fa1 100644
--- a/src/plugins/Pornhub.cpp
+++ b/src/plugins/Pornhub.cpp
@@ -131,6 +131,13 @@ namespace QuickMedia {
return get_videos_in_page(url, is_tor_enabled(), result_items);
}
+ PluginResult PornhubSearchPage::get_page(const std::string &str, int page, BodyItems &result_items) {
+ std::string url = "https://www.pornhub.com/video/search?search=";
+ url += url_param_encode(str);
+ url += "&page=" + std::to_string(1 + page);
+ return search_result_to_plugin_result(get_videos_in_page(url, is_tor_enabled(), result_items));
+ }
+
PluginResult PornhubSearchPage::submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
(void)title;
(void)url;