summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2021-09-05 14:29:02 +0100
committerrafa_99 <raroma09@gmail.com>2021-09-05 14:29:02 +0100
commitf033fc79eab50c183fbd9e9e7d1c9ca342b7bd96 (patch)
treee36421e632caaad3a551746b1fb50e628d4a90f0
parent80bc5ce11e3d99952c004674c7e2ffab3efb63e4 (diff)
Final Touches
-rw-r--r--Makefile2
-rw-r--r--queryt.12
-rw-r--r--queryt.c5
3 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 08ca1f5..836be06 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ FLAGS = -march=native -O3 -pipe -faggressive-loop-optimizations
LIBS = -lcurl -ljson-c
# Compiled Code
-CLEAN = queryt
+CLEAN = queryt queryt_debug
# MakeOPTS
build: clean
diff --git a/queryt.1 b/queryt.1
index 4b507e1..d0650e5 100644
--- a/queryt.1
+++ b/queryt.1
@@ -9,7 +9,7 @@ queryt \- API keyless YouTube querying tool.
Query various searches from YouTube to standard output.
.TP
\fB\-f\fR, \fB\-\-format\fR
-uses format modifiers to customize the output \fB[aditRT]\fR
+uses format modifiers to customize the output \fB[aditRT]\fR
.TP
\fB\-m\fR, \fB\-\-max\fR
defines the max number of displayed results\fR
diff --git a/queryt.c b/queryt.c
index edf9d01..205e31e 100644
--- a/queryt.c
+++ b/queryt.c
@@ -8,6 +8,7 @@
#include "libs/json.h"
#define VERSION "1.0"
+#define SEARCHLINK "https://www.youtube.com/results?search_query="
void processOptions(int *options, char **args, int argc);
@@ -74,8 +75,8 @@ void processOptions(int *options, char **args, int argc)
char *query = queryNormalizer(args[2]);
if ( query != NULL )
{
- char *link = (char *) calloc(strlen("https://www.youtube.com/results?search_query=") + strlen(query) + 1, sizeof(char));
- strcpy(link, "https://www.youtube.com/results?search_query=");
+ char *link = (char *) calloc(strlen(SEARCHLINK) + strlen(query) + 1, sizeof(char));
+ strcpy(link, SEARCHLINK);
strcat(link, query);
char *json = extractQueryJSON(link);