summaryrefslogtreecommitdiff
path: root/getgbook.c
diff options
context:
space:
mode:
Diffstat (limited to 'getgbook.c')
-rw-r--r--getgbook.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/getgbook.c b/getgbook.c
index e6e15af..5e36c04 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -16,6 +16,7 @@
" -n download pages from numbers in stdin\n" \
" otherwise, all available pages will be downloaded\n"
+#define USESSL 1
#define URLMAX 1024
#define STRMAX 1024
#define MAXPAGES 9999
@@ -44,7 +45,7 @@ int getpagelist()
snprintf(url, URLMAX, "/books?id=%s&printsec=frontcover&redir_esc=y", bookid);
- if(!get("books.google.com", url, NULL, NULL, &buf, 1))
+ if(!get("books.google.com", USESSL, url, NULL, NULL, &buf, 1))
return 1;
if((s = strstr(buf, "_OC_Run({\"page\":[")) == NULL)
@@ -83,7 +84,7 @@ int getpageurls(char *pagecode, char *cookie)
snprintf(url, URLMAX, "/books?id=%s&pg=%s&jscmd=click3&q=subject:a&redir_esc=y", bookid, pagecode);
- if(!get("books.google.com", url, cookie, NULL, &buf, 1))
+ if(!get("books.google.com", USESSL, url, cookie, NULL, &buf, 1))
return 1;
c = buf;
@@ -137,7 +138,7 @@ int getpage(Page *page)
return 1;
}
- if(gettofile("books.google.com", page->url, page->cookie, NULL, path, 0)) {
+ if(gettofile("books.google.com", USESSL, page->url, page->cookie, NULL, path, 0)) {
fprintf(stderr, "%s failed\n", page->name);
return 1;
}
@@ -188,7 +189,7 @@ int main(int argc, char *argv[])
/* get cookies */
for(i=0;i<COOKIENUM;i++) {
- if(get("books.google.com", "/", NULL, cookies[i], &tmp, 0))
+ if(get("books.google.com", USESSL, "/", NULL, cookies[i], &tmp, 0))
free(tmp);
}