diff options
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r-- | src/plugins/Fourchan.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp index 4b2ca61..d4fb726 100644 --- a/src/plugins/Fourchan.cpp +++ b/src/plugins/Fourchan.cpp @@ -462,9 +462,9 @@ namespace QuickMedia { } std::vector<CommandArg> additional_args = { - CommandArg{"-F", "id=" + token}, - CommandArg{"-F", "pin=" + pin}, - CommandArg{"-F", "xhr=1"}, + CommandArg{"--form-string", "id=" + token}, + CommandArg{"--form-string", "pin=" + pin}, + CommandArg{"--form-string", "xhr=1"}, CommandArg{"-c", cookies_filepath.data} }; @@ -502,29 +502,22 @@ namespace QuickMedia { PostResult FourchanThreadPage::post_comment(const std::string &captcha_id, const std::string &comment, const std::string &filepath) { std::string url = "https://sys.4chan.org/" + board_id + "/post"; - std::string comment_fixed = comment; - if(comment_fixed[0] == '@') - comment_fixed = "\\" + comment_fixed; std::vector<CommandArg> additional_args = { CommandArg{"-H", "Referer: https://boards.4chan.org/"}, CommandArg{"-H", "Origin: https://boards.4chan.org"}, - CommandArg{"-F", "resto=" + thread_id}, - CommandArg{"-F", "com=" + comment_fixed}, - CommandArg{"-F", "mode=regist"} + CommandArg{"--form-string", "resto=" + thread_id}, + CommandArg{"--form-string", "com=" + comment}, + CommandArg{"--form-string", "mode=regist"} }; if(!filepath.empty()) { - std::string filename = file_get_filename(filepath); - if(filename[0] == '@') - filename = "\\" + filename; - additional_args.push_back({ "-F", "upfile=@" + filepath }); - additional_args.push_back({ "-F", "filename=" + filename }); + additional_args.push_back({ "--form-string", "filename=" + file_get_filename(filepath) }); } if(pass_id.empty()) { - additional_args.push_back(CommandArg{"-F", "g-recaptcha-response=" + captcha_id}); + additional_args.push_back(CommandArg{"--form-string", "g-recaptcha-response=" + captcha_id}); } else { Path cookies_filepath; if(get_cookies_filepath(cookies_filepath, SERVICE_NAME) != 0) { |