summaryrefslogtreecommitdiffstats
path: root/src/api.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api.c b/src/api.c
index 9a9bbc8..709e2e2 100644
--- a/src/api.c
+++ b/src/api.c
@@ -174,6 +174,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
rs = -2;
goto rc;
}
+ /* TODO: check if response is asking for a captcha */
if (opt & SC_OPT_IMAGE) {
imageclass = sc_find_class(txtdoc, "{font-family:Roboto,Helvetica,Arial,sans-serif}");
if (!imageclass) {
@@ -185,7 +186,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
titleclass = sc_find_class(txtdoc, "{color:#1967D2;font-size:14px;line-height:16px}");
descclass = sc_find_class(txtdoc, "{word-break:break-word}");
if (!titleclass || !descclass) {
- SC_LOG(SC_LOG_ERROR, c, "!titleclass || !descclass");
+ SC_LOG(SC_LOG_ERROR, c, "!titleclass || !descclass, txtdoc = %s", txtdoc);
rs = -4;
goto rc;
}
@@ -218,7 +219,7 @@ struct sc_query * sc_query_google (const char * s, struct sc_cache * c, struct s
SC_LOG(SC_LOG_DEBUG, c, "hreflink = %s", hreflink);
sscanf(hreflink, "/imgres?imgurl=%m[^&]&imgrefurl=%m[^&]", &imgurl, &imgrefurl);
if (!imgurl && !imgrefurl) {
- SC_LOG(SC_LOG_ERROR, c, "!imgurl && !imgrefurl");
+ SC_LOG(SC_LOG_ERROR, c, "!imgurl && !imgrefurl, txtdoc = %s", txtdoc);
/* rs = -6; */ /* we continue running not fail because of a single picture */
free(imgurl);
free(imgrefurl);