aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-19 19:28:45 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-19 19:28:45 +0200
commitcd4d2e98c34ed413ca164dbad61ba19636377f77 (patch)
tree69a1ab7f19acc4b9abf016025921efed3b80c2a9 /src/plugins/Fourchan.cpp
parente671784144174c4fceaa6df3737ba9b4de4a6c63 (diff)
Add hotexamples
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp23
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) {