summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2021-08-31 20:55:49 +0100
committerrafa_99 <raroma09@gmail.com>2021-08-31 20:55:49 +0100
commit3b9a6fd52393f7509b9c575ed5e6dbc37c43b653 (patch)
tree6e18d57ba2dda80f7331ade3cec1938ef66cf2e2 /utils.c
parent1ae42e9828b154032bd94f7b0d72b33de879be7c (diff)
Little Refactor
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c6
1 files changed, 3 insertions, 3 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));