QUOTE(spyps @ Oct 4 2020, 02:48)
I tried this method with [
www.dlsite.com]
https://www.dlsite.com/books/work/=/product_id/BJ255317.html, but it didn't work.
I got error message "Cannot read property 'toDataURL' of null"I
My guide was for DMM. I checked the DLSite browser viewer. There are 3 canvases for the current, previous and next pages, and the pages can be downloaded even while they aren't visible (unlike DMM). So you should execute
CODE
filename = 1
a = document.createElement('a')
function downloadCanvas() {
canvases = document.querySelectorAll('canvas')
for (canvas of [canvases[1], canvases[0], canvases[2]].filter(canvas => canvas)) {
a.href = canvas.toDataURL('image/jpeg')
a.download = filename++
a.click()
}
}
downloadCanvas()
after moving 1 page forward once, then
CODE
downloadCanvas()
every 3 pages. You will probably have to manually fix the numbers of the last pages if their count isn't a multiple of 3.
The device-mode trick isn't necessary here since canvases are drawn at a fixed size at any viewport dimensions, and later adapted to the viewport. But they have slightly smaller dimensions and bigger aspect ratio then the original images for some reason. On the manga I'm testing it the canvas is 740x1036 and the original images 768x1152. I wouldn't know how to make them exact.
But can't you rip DLsite images from the desktop application? That would be faster and accurate.
As for the quality: I don't notice any visible difference if I try to convert some original pngs anyway, so I don't mind downloading lighter images and save disk space. In fact, I save them as webp to save even more space (and there's no reason to use jpg, an encoding from 1992, other than compatibility with Internet Explorer and previous Safari versions). Though if you save them as webp you may want to try increasing the quality with the second argument of toDataURL:
CODE
toDataURL('image/webp', .85)
The defaults are .92 for jpeg and .8 webp.
Avoiding multiple compressions would be nice, but it's not worth manually screenshotting every page.
And it's not like DMM versions have perfect quality to begin with. I often find higher resolution versions on hitomi.la, not to mention the Fakku versions which look like way better.
But I can see how you'd want the best possibile quality if you plan to share them.
As for png compression: I recommend pngquant.
As for DRM-free DMM doujin: I don't get it, why don't you download the zip archives directly?
As for EPUB/dmmr files: I would also like to know. My image viewer guide was simply an adaption of [
pastebin.com]
https://pastebin.com/GNYZDAUy, but I haven't found anything for dmmr. For now I just saved every page of the ones I had bought as images which was painful, and I will see if an OCR application like tesseract can extract the text decently, but I don't think it works with furigana
.
For DMM/R18.com videos, I recommend [
github.com]
hlsdl.
This post has been edited by Nalien: Oct 12 2020, 17:22