summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c6
-rw-r--r--utils.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/utils.c b/utils.c
index 76a9eea..57bd994 100644
--- a/utils.c
+++ b/utils.c
@@ -155,14 +155,14 @@ int* jsonDataLimits(int tokenCount, char **tokens, char *topDelimiter, char *bot
return limits;
}
-char *curlToJSON(char *url)
+char* extractQueryJSON(char *youtubeurl)
{
char *json = NULL;
- if (url != NULL && strlen(url) > 0)
+ if (youtubeurl != NULL && strlen(youtubeurl) > 0)
{
// Setting Up Vars
- char jsonVar[] = "ytInitialData", unneededHtml[] = ";</script><script", *htmlPage = downloadPage(url), **tokens = tokenizer(htmlPage, " ");
+ char jsonVar[] = "ytInitialData", unneededHtml[] = ";</script><script", *htmlPage = downloadPage(youtubeurl), **tokens = tokenizer(htmlPage, " ");
int numberOfTokens = tokenCount(htmlPage, " "), *limits = jsonDataLimits(numberOfTokens, tokens, jsonVar, unneededHtml);
json = (char *)calloc(1, sizeof(char));
diff --git a/utils.h b/utils.h
index ac55ffa..987b7fe 100644
--- a/utils.h
+++ b/utils.h
@@ -4,5 +4,4 @@ int tokenCount(char *string, char *delimiter);
char** tokenizer(char *string, char *delimiter);
void freeTokens(char **tokens, int size);
char* queryNormalizer(char *query);
-int* jsonDataLimits(int tokenCount, char **tokens, char *topDelimiter, char *bottomDelimiter);
-char* curlToJSON(char *url);
+char* extractQueryJSON(char *youtubeurl);