From 93d17e32d2c64a187bda4e4c7b0162072ab77c9c Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 28 Jul 2015 16:20:28 +0100 Subject: Add SSL support using OpenSSL, and enable it for getgbook. This fixes the problem with getgbook not finding any books, and also obviously adds SSL, which is great! --- getabook.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'getabook.c') diff --git a/getabook.c b/getabook.c index db4ca96..5f85143 100644 --- a/getabook.c +++ b/getabook.c @@ -15,6 +15,7 @@ " -n download pages from numbers in stdin\n" \ " otherwise, all available pages will be downloaded\n" +#define USESSL 0 #define URLMAX 1024 #define STRMAX 1024 #define MAXPAGES 9999 @@ -74,7 +75,7 @@ int getpagelist() snprintf(url, URLMAX, "/gp/search-inside/service-data?method=getBookData&asin=%s", bookid); - if(!get("www.amazon.com", url, NULL, NULL, &buf, 1)) + if(!get("www.amazon.com", USESSL, url, NULL, NULL, &buf, 1)) return 1; /* amazon have a canonical asin, which is needed to get all available pages */ @@ -132,7 +133,7 @@ int getpageurls(int pagenum) strncpy(url, "/gp/search-inside/service-data", URLMAX); snprintf(query, URLMAX, "method=goToPage&asin=%s&page=%d", bookid, pagenum); - if(!post("www.amazon.com", url, NULL, NULL, query, &buf, 1)) + if(!post("www.amazon.com", USESSL, url, NULL, NULL, query, &buf, 1)) return 1; fillurls(buf); @@ -158,7 +159,7 @@ int getpage(Page *page) return 1; } - if(gettofile(host, page->url, NULL, NULL, path, 0)) { + if(gettofile(host, USESSL, page->url, NULL, NULL, path, 0)) { fprintf(stderr, "%d failed\n", page->num); return 1; } -- cgit v1.2.3