aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Mangatown.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Mangatown.cpp')
-rw-r--r--src/plugins/Mangatown.cpp13
1 files changed, 11 insertions, 2 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;