Created
June 19, 2023 06:44
-
-
Save oriolgual/fd6f10c6efada0802f17207fe0cda2d2 to your computer and use it in GitHub Desktop.
Download ebook from Tagus as images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IO.CS.readChunkSilent = function (a, b, c, d, e, f) { | |
var g = {}; | |
Book.mode == Book.IMAGE && | |
( | |
g = { | |
readMode: 'IMAGE', | |
imageSize: 'LARGE' | |
}, | |
e = e || | |
{ | |
}, | |
e.timeout = IO.IGNORE | |
), | |
IO.JSONP.get( | |
IO.CS.prefix + 'rest/epub/readChunkSilent/' + a + '/' + b + '/' + c + '/', | |
g, | |
d, | |
e, | |
f | |
) | |
} | |
window.counter = 0 | |
function saveImage(data, counter) { | |
var a = document.createElement("a"); | |
a.href = data | |
a.download = `Image${counter}.png`; | |
a.click(); | |
} | |
function saveAndNext() { | |
saveImage($(".vcdl-page-text img")[0].attributes['src'].value, window.counter) | |
Interface.Multilayer.hide(!1), Book.Pages.change(1) | |
window.counter = window.counter + 1 | |
} | |
function doIt() { | |
setTimeout(saveAndNext, 500) | |
setTimeout(saveAndNext, 1000) | |
setTimeout(saveAndNext, 1500) | |
setTimeout(saveAndNext, 2000) | |
var id=setTimeout(doIt, 7000) | |
console.log(`Timeout id: ${id}`) | |
} | |
// clearTimeout(id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment