aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp15
-rw-r--r--src/plugins/Manganelo.cpp2
2 files changed, 13 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index a7fca2d..d3627e1 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1246,8 +1246,19 @@ namespace QuickMedia {
if(get_file_type(image_filepath) != FileType::FILE_NOT_FOUND)
return true;
+ std::vector<CommandArg> extra_args;
+ if(current_plugin->name == "manganelo") {
+ extra_args = {
+ CommandArg { "-H", "accept: image/webp,image/apng,image/*,*/*;q=0.8" },
+ CommandArg { "-H", "sec-fetch-site: cross-site" },
+ CommandArg { "-H", "sec-fetch-mode: no-cors" },
+ CommandArg { "-H", "sec-fetch-dest: image" },
+ CommandArg { "-H", "referer: https://manganelo.com/" }
+ };
+ }
+
std::string image_content;
- if(download_to_string(url, image_content, {}, current_plugin->use_tor) != DownloadResult::OK || image_content.size() <= 255) {
+ if(download_to_string(url, image_content, extra_args, current_plugin->use_tor, true) != DownloadResult::OK || image_content.size() <= 255) {
if(current_plugin->name == "manganelo") {
bool try_backup_url = false;
std::string new_url = url;
@@ -1259,7 +1270,7 @@ namespace QuickMedia {
if(try_backup_url) {
image_content.clear();
- if(download_to_string(new_url, image_content, {}, current_plugin->use_tor) != DownloadResult::OK || image_content.size() <= 255) {
+ if(download_to_string(new_url, image_content, extra_args, current_plugin->use_tor, true) != DownloadResult::OK || image_content.size() <= 255) {
show_notification("Manganelo", "Failed to download image: " + new_url, Urgency::CRITICAL);
return false;
}
diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp
index 89f882c..a4c8809 100644
--- a/src/plugins/Manganelo.cpp
+++ b/src/plugins/Manganelo.cpp
@@ -125,9 +125,7 @@ namespace QuickMedia {
auto *urls = (std::vector<std::string>*)userdata;
const char *src = quickmedia_html_node_get_attribute_value(node, "src");
if(src) {
- // TODO: If image loads too slow, try switching mirror
std::string image_url = src;
- //string_replace_all(image_url, "s3.mkklcdnv3.com", "bu.mkklcdnbuv1.com");
urls->emplace_back(std::move(image_url));
}
}, &last_chapter_image_urls);