-
Notifications
You must be signed in to change notification settings - Fork 0
/
Download-TMO-Images.js
38 lines (35 loc) · 1.23 KB
/
Download-TMO-Images.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// ==UserScript==
// @name Download-TMO-Images
// @version 1
// @namespace zack0zack
// @description tmofans.com descarga todas las imagenes del capitulo en cascada
// @icon
// @include https://lectortmo.com/viewer/*/cascade
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.0.2/jszip-utils.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js
// @run-at document-end
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_download
// @grant GM_addStyle
// @connect self
// @connect *
// @nocompat Chrome
// @noframes
// ==/UserScript==
var images = document.getElementsByTagName('img');
var title = document.getElementsByTagName('h2');
var i = 0;
var fileName = "";
setInterval(function(){
if(images.length > i){
filename = title[0].innerText + ' - ' + i + getExtension(images[i].dataset.src);
GM_download(images[i].dataset.src, filename);
i++;
}
},200);
function getExtension(url) {
return url.split('?')[0].match(/\.\w+$/)[0];
}