spelufo / books-dl

Google Books Downloader / Image Scraper
53 stars 11 forks source link

High resolution force #1

Closed ghost closed 9 years ago

ghost commented 9 years ago

The images that are saved to disk are not high resolution. High resolution can be forced to modify the &w= get parameter to 1200 (this ensures that the images are 1200px wide).

I've tried this:

img.src = img.src.replace(/&w=\d+$/, "&w=1200");

in the function getPageImage() but then the images are corrupted.

How can we force to download the high resolution of the image?

spelufo commented 9 years ago

I would try using the zoomIn method from their API.

ghost commented 9 years ago

Thanks! Using this now:

google.load("books", "0");
google.setOnLoadCallback(function initialize() {
  viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'));
  viewer.load(bookid, null, alertInitialized);
})

function alertInitialized() {
  for(var i=0;i<7;i++) {
    viewer.zoomIn();
  }
  setTimeout(nextPage, 3000);
}