diff options
Diffstat (limited to 'getabook.c')
-rw-r--r-- | getabook.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -15,7 +15,7 @@ " -n download pages from numbers in stdin\n" \ " otherwise, all available pages will be downloaded\n" -#define USESSL 0 +#define USESSL 1 #define URLMAX 2048 #define STRMAX 1024 #define MAXPAGES 9999 @@ -75,8 +75,10 @@ int getpagelist() snprintf(url, URLMAX, "/gp/search-inside/service-data?method=getBookData&asin=%s", bookid); - if(!get("www.amazon.com", USESSL, url, NULL, NULL, &buf, 1)) + if(!get("www.amazon.com", USESSL, url, NULL, NULL, &buf, 1)) { + fprintf(stderr, "failed to get url %s\n", url); return 1; + } /* amazon have a canonical asin, which is needed to get all available pages */ if((s = strstr(buf, "\"ASIN\":\"")) != NULL) { @@ -154,7 +156,7 @@ int getpage(Page *page) return 1; } - if(!sscanf(page->url, "http://%[^/]/", host)) { + if(!sscanf(page->url, "https://%[^/]/", host)) { fprintf(stderr, "can't parse host of %s\n", page->url); return 1; } |