-
+
19void aria2_download(
char *tags,
bool is_nsfw,
char *uname,
char *apikey,
int page,
int lim)
21 char *request_string = (
char*)malloc(256 *
sizeof(
char));
@@ -126,11 +126,11 @@
-
32 sprintf(request_string,
"aria2c \"https://e621.net/posts.json?limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", lim, page, tags);
+
32 sprintf(request_string,
"aria2c \"https://e621.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
-
36 sprintf(request_string,
"aria2c \"https://e926.net/posts.json?limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", lim, page, tags);
+
36 sprintf(request_string,
"aria2c \"https://e926.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
@@ -145,7 +145,7 @@
-
void aria2_download(char *tags, int page, bool is_nsfw, int lim)
downloads the API response by using aria2c, works with a system call
+
void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
downloads the API response by using aria2c, works with a system call
void malloc_error_msg()
Shows some information when yiffy cannot allocate memory.
void system_func_error_msg()
Shows some information when system function not works.
diff --git a/docs/html/dc/d3b/show__config_8c_source.html b/docs/html/dc/d3b/show__config_8c_source.html
index ebe09b41..d73fe0d1 100644
--- a/docs/html/dc/d3b/show__config_8c_source.html
+++ b/docs/html/dc/d3b/show__config_8c_source.html
@@ -153,8 +153,8 @@
-
55 fprintf(stdout,
"current yiffy configurations\n");
-
56 fprintf(stdout,
"----------------------------\n");
+
55 fprintf(stdout,
"yiffy configurations (config.txt)\n");
+
56 fprintf(stdout,
"---------------------------------\n");
@@ -178,8 +178,8 @@
-
81 fprintf(stdout,
"current yiffy credentials\n");
-
82 fprintf(stdout,
"-------------------------\n");
+
81 fprintf(stdout,
"yiffy credentials (credentials.txt)\n");
+
82 fprintf(stdout,
"-----------------------------------\n");
diff --git a/docs/html/dc/dec/search_8c_source.html b/docs/html/dc/dec/search_8c_source.html
index df612c23..f871ab09 100644
--- a/docs/html/dc/dec/search_8c_source.html
+++ b/docs/html/dc/dec/search_8c_source.html
@@ -197,7 +197,7 @@
-
+
105 FILE *posts_json_file = fopen(
"posts.json",
"r");
@@ -277,7 +277,7 @@
-
void aria2_download(char *tags, int page, bool is_nsfw, int lim)
downloads the API response by using aria2c, works with a system call
+
void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
downloads the API response by using aria2c, works with a system call
void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls)
Creates a new window to display the controls and adds it to the specified position.
void create_post_tags_window(WINDOW *window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
diff --git a/docs/html/de/d0c/show__help_8c_source.html b/docs/html/de/d0c/show__help_8c_source.html
index 11605bdb..26914cd2 100644
--- a/docs/html/de/d0c/show__help_8c_source.html
+++ b/docs/html/de/d0c/show__help_8c_source.html
@@ -115,36 +115,36 @@
-
18 fprintf(stdout,
"usage: yiffy [OPTION]\n");
+
18 fprintf(stdout,
"usage: yiffy [option]\n");
19 fprintf(stdout,
"use e621 and e926 from the terminal interface\n\n");
21 fprintf(stdout,
"yiffy search tui argument\n");
22 fprintf(stdout,
"-------------------------\n");
-
23 fprintf(stdout,
"--search \"[TAGS]\" opens a tui interface\n\n");
+
23 fprintf(stdout,
"--search [tags] opens a tui interface\n\n");
25 fprintf(stdout,
"yiffy api fetch arguments\n");
26 fprintf(stdout,
"-------------------------\n");
-
27 fprintf(stdout,
"--fetch \"[TAGS]\" fetches urls\n");
-
28 fprintf(stdout,
"--dfetch \"[TAGS]\" fetches urls and downloads\n\n");
+
27 fprintf(stdout,
"--fetch [tags] fetches urls\n");
+
28 fprintf(stdout,
"--dfetch [tags] fetches urls and downloads\n\n");
30 fprintf(stdout,
"yiffy information menu arguments\n");
31 fprintf(stdout,
"--------------------------------\n");
-
32 fprintf(stdout,
"--help outputs the help menu\n");
-
33 fprintf(stdout,
"--version outputs the version\n");
-
34 fprintf(stdout,
"--github outputs the github url\n");
-
35 fprintf(stdout,
"--config outputs the configs-credentials\n\n");
+
32 fprintf(stdout,
"--help outputs the help menu\n");
+
33 fprintf(stdout,
"--version outputs the version\n");
+
34 fprintf(stdout,
"--github outputs the github url\n");
+
35 fprintf(stdout,
"--config outputs the configs-credentials\n\n");
37 fprintf(stdout,
"yiffy data import-export arguments\n");
-
38 fprintf(stdout,
"-----------------------------------\n");
-
39 fprintf(stdout,
"--import imports the data to program\n");
-
40 fprintf(stdout,
"--export exports the data from program\n\n");
+
38 fprintf(stdout,
"----------------------------------\n");
+
39 fprintf(stdout,
"--import imports the data to program\n");
+
40 fprintf(stdout,
"--export exports the data from program\n\n");
42 fprintf(stdout,
"yiffy config and credential arguments\n");
43 fprintf(stdout,
"-------------------------------------\n");
-
44 fprintf(stdout,
"--nsfw \"[ON/OFF]\" switches to nsfw/sfw options\n");
-
45 fprintf(stdout,
"--ivcommand \"[CMD]\" sets the image viewer command\n");
-
46 fprintf(stdout,
"--uname \"[UNAME]\" sets the username\n");
-
47 fprintf(stdout,
"--apikey \"[API KEY]\" sets the api key\n");
+
44 fprintf(stdout,
"--nsfw [on/off] switches to nsfw/sfw options\n");
+
45 fprintf(stdout,
"--ivcommand [cmd] sets the image viewer command\n");
+
46 fprintf(stdout,
"--uname [uname] sets the username\n");
+
47 fprintf(stdout,
"--apikey [apikey] sets the api key\n");
void show_help()
Shows the general help menu to user.
diff --git a/docs/html/globals.html b/docs/html/globals.html
index 3f85a16d..78a8faea 100644
--- a/docs/html/globals.html
+++ b/docs/html/globals.html
@@ -114,7 +114,7 @@
- a -
diff --git a/docs/html/globals_func.html b/docs/html/globals_func.html
index a4a19129..5b6f8411 100644
--- a/docs/html/globals_func.html
+++ b/docs/html/globals_func.html
@@ -113,7 +113,7 @@
- a -
diff --git a/docs/html/navtreeindex0.js b/docs/html/navtreeindex0.js
index b96e5622..71cd3349 100644
--- a/docs/html/navtreeindex0.js
+++ b/docs/html/navtreeindex0.js
@@ -181,7 +181,7 @@ var NAVTREEINDEX0 =
"d6/d49/cjson_8c.html#aed7e219a2b9187880c97c6f0ea5fa1b4":[6,0,0,1,0,21],
"d6/d49/cjson_8c_source.html":[6,0,0,1,0],
"d6/d60/aria2__download_8c.html":[6,0,0,3,0],
-"d6/d60/aria2__download_8c.html#a5d6732ce337f794d14f9f2b835a0d2ef":[6,0,0,3,0,0],
+"d6/d60/aria2__download_8c.html#a89f12219462c5d1dd6d1d1dc2896914d":[6,0,0,3,0,0],
"d6/d60/aria2__download_8c_source.html":[6,0,0,3,0],
"d6/dd7/conf__successful__msg_8c.html":[6,0,0,5,5],
"d6/dd7/conf__successful__msg_8c.html#a4c232dc73b53a88d1d351208928e889c":[6,0,0,5,5,0],
diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js
index 6dcd2161..7eebe32f 100644
--- a/docs/html/search/all_0.js
+++ b/docs/html/search/all_0.js
@@ -8,6 +8,6 @@ var searchData=
['argc_5ferror_5fmsg_5',['argc_error_msg',['../d3/de0/argc__error__msg_8c.html#a020d66de7fd128881c8398247a0d0bdd',1,'argc_error_msg(int argc): argc_error_msg.c'],['../d0/de2/yiffy__messages_8h.html#a020d66de7fd128881c8398247a0d0bdd',1,'argc_error_msg(int argc): argc_error_msg.c']]],
['argc_5ferror_5fmsg_2ec_6',['argc_error_msg.c',['../d3/de0/argc__error__msg_8c.html',1,'']]],
['argc_5fqty_5ferror_7',['ARGC_QTY_ERROR',['../dc/dc0/yiffy_8c.html#a667329addeab5d6f7d3f18fc38bd9b90',1,'yiffy.c']]],
- ['aria2_5fdownload_8',['aria2_download',['../d6/d60/aria2__download_8c.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): aria2_download.c'],['../d5/d05/yiffy__fetch_8h.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): aria2_download.c']]],
+ ['aria2_5fdownload_8',['aria2_download',['../d6/d60/aria2__download_8c.html#a89f12219462c5d1dd6d1d1dc2896914d',1,'aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim): aria2_download.c'],['../d5/d05/yiffy__fetch_8h.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): yiffy_fetch.h']]],
['aria2_5fdownload_2ec_9',['aria2_download.c',['../d6/d60/aria2__download_8c.html',1,'']]]
];
diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js
index 234c9cad..690704a2 100644
--- a/docs/html/search/functions_0.js
+++ b/docs/html/search/functions_0.js
@@ -4,5 +4,5 @@ var searchData=
['allocate_1',['allocate',['../d1/d07/structinternal__hooks.html#a8b8f7ff45faa5da18dd3ccd2a2c8e416',1,'internal_hooks']]],
['already_5fconf_5fmsg_2',['already_conf_msg',['../da/d03/already__conf__msg_8c.html#a2b3c403bb7977f8a7672f39dec8d5659',1,'already_conf_msg(char *option, char *argv): already_conf_msg.c'],['../d0/de2/yiffy__messages_8h.html#a2b3c403bb7977f8a7672f39dec8d5659',1,'already_conf_msg(char *option, char *argv): already_conf_msg.c']]],
['argc_5ferror_5fmsg_3',['argc_error_msg',['../d3/de0/argc__error__msg_8c.html#a020d66de7fd128881c8398247a0d0bdd',1,'argc_error_msg(int argc): argc_error_msg.c'],['../d0/de2/yiffy__messages_8h.html#a020d66de7fd128881c8398247a0d0bdd',1,'argc_error_msg(int argc): argc_error_msg.c']]],
- ['aria2_5fdownload_4',['aria2_download',['../d6/d60/aria2__download_8c.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): aria2_download.c'],['../d5/d05/yiffy__fetch_8h.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): aria2_download.c']]]
+ ['aria2_5fdownload_4',['aria2_download',['../d6/d60/aria2__download_8c.html#a89f12219462c5d1dd6d1d1dc2896914d',1,'aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim): aria2_download.c'],['../d5/d05/yiffy__fetch_8h.html#a5d6732ce337f794d14f9f2b835a0d2ef',1,'aria2_download(char *tags, int page, bool is_nsfw, int lim): yiffy_fetch.h']]]
];
diff --git a/src/fetch/aria2_download.c b/src/fetch/aria2_download.c
index a7523094..bd88d548 100644
--- a/src/fetch/aria2_download.c
+++ b/src/fetch/aria2_download.c
@@ -16,7 +16,7 @@
/// @param tags These are the e621-e926 tags prompted by the user as an argument value. Example: yiffy --fetch "anthro+fur+male+smile".
/// @param page This is the value that is passed to the API to get results from the specified pages.
/// @param is_nsfw This is the boolean value that checks the NSFW option. If true, sets the request string for e621 otherwise sets for e926.
-void aria2_download(char *tags, int page, bool is_nsfw, int lim)
+void aria2_download(char *tags, bool is_nsfw, char *uname, char *apikey, int page, int lim)
{
char *request_string = (char*)malloc(256 * sizeof(char));
@@ -29,11 +29,11 @@ void aria2_download(char *tags, int page, bool is_nsfw, int lim)
/* Set the string for NSFW or SFW option by checking the isNsfw parameter. */
if (is_nsfw)
{
- sprintf(request_string, "aria2c \"https://e621.net/posts.json?limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", lim, page, tags);
+ sprintf(request_string, "aria2c \"https://e621.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
}
else
{
- sprintf(request_string, "aria2c \"https://e926.net/posts.json?limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", lim, page, tags);
+ sprintf(request_string, "aria2c \"https://e926.net/posts.json?login=%s&api_key=%s&limit=%d&page=%d&tags=%s\" -o posts.json >/dev/null 2>&1", uname, apikey, lim, page, tags);
}
/* Download the JSON and set a sleep(1) for signals. */