// ==UserScript== // @name MangaDex Downloader - Gallery-dl // @version 2.0.1 // @description Batch download mangadex manga with Gallery-dl // @author Gondola#7671 // @grant GM_addStyle // @grant GM_setClipboard // @run-at document-idle // @match https://mangadex.org/* // @compatible firefox // @compatible chrome // @namespace https://greasyfork.org/users/581457 // @downloadURL https://update.greasyfork.icu/scripts/416674/MangaDex%20Downloader%20-%20Gallery-dl.user.js // @updateURL https://update.greasyfork.icu/scripts/416674/MangaDex%20Downloader%20-%20Gallery-dl.meta.js // ==/UserScript== //TODO: Fix input background when page resizes (function() { // USER VARIABLES var language_filter = "en" GM_addStyle(" #gallery-dl { color: #fff; font-weight: 500; } #gallery-dl { background-color: #FF6740 !important; height: 40px; border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; margin-right: 0px !important; transition: background-color .1s ease-out, color .1s ease-out; } #gallery-dl:hover { background-color: #cc5233 !important;; } #gallery-dl:active { background-color: #993e26 !important;; } .gallery-dl_input { background-color: #333333aa !important; width: 54px; height: 40px; text-align: center; border-radius: 0.25rem; } .gallery-dl_input:focus-visible { outline: none; } #gallery-dl_to_text { background-color: #333333aa !important; padding-left: 7px; padding-right: 7px; padding-top: 3px; padding-bottom: 3px; user-select: none; } #gallery_dl_from { border-top-left-radius: 0px; border-bottom-left-radius: 0px; } #icon_download { width: 24px; rotate: 180deg; float: left; margin-top: 2px; margin-left: 10px; margin-right: 10px } #gallery-dl-container{ display:flex; align-items:center; float:left; margin-left:15px; }") function gallery_all() { var gall_from = 0 var gall_to = 99999 if(document.getElementById("gallery_dl_from").value != "") { gall_from = document.getElementById("gallery_dl_from").value } if(document.getElementById("gallery_dl_to").value != "") { gall_to = document.getElementById("gallery_dl_to").value } if(document.getElementById("gallery_dl_from").value === "" && document.getElementById("gallery_dl_to").value === "") { GM_setClipboard("gallery-dl --chapter-filter \"lang == '" + language_filter + "'\" \"" + window.location.href + "\"") } else { GM_setClipboard("gallery-dl --chapter-filter \"lang == '" + language_filter + "' and " + gall_from + " <= chapter < " + gall_to + "\" \"" + window.location.href + "\"") } } var page_loaded = false setInterval(function() { while(!page_loaded){ document.getElementsByClassName("nav-bar")[0].insertAdjacentHTML( 'afterbegin', '