diff options
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r-- | src/QuickMedia.cpp | 15 |
1 files changed, 13 insertions, 2 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; } |