|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# FeedCrawler |
| 3 | +# Projekt von https://github.com/rix1337 |
| 4 | +# Dieses Modul stellt Tampermonkey-Scripte für die API des FeedCrawlers bereit. |
| 5 | + |
| 6 | +def get_feedcrawler_helper_sj(sj, dj): |
| 7 | + return f"""// ==UserScript== |
| 8 | + // @name FeedCrawler Helper (SJ/DJ) |
| 9 | + // @author rix1337 |
| 10 | + // @description Forwards decrypted SJ/DJ Download links to FeedCrawler |
| 11 | + // @version 0.3.0 |
| 12 | + // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js |
| 13 | + // @match https://{sj}/* |
| 14 | + // @match https://{dj}/* |
| 15 | + // @exclude https://{sj}/serie/search?q=* |
| 16 | + // @exclude https://{dj}/serie/search?q=* |
| 17 | + // ==/UserScript== |
| 18 | +
|
| 19 | + document.body.addEventListener('mousedown', function (e) {{ |
| 20 | + if (e.target.tagName != "A") return; |
| 21 | + var anchor = e.target; |
| 22 | + if (anchor.href.search(new RegExp('{sj}/serie//i')) != -1) {{ |
| 23 | + anchor.href = anchor.href + '#' + anchor.text; |
| 24 | + }} else if (anchor.href.search(new RegExp('{dj}/serie//i')) != -1) {{ |
| 25 | + anchor.href = anchor.href + '#' + anchor.text; |
| 26 | + }} |
| 27 | + }}); |
| 28 | +
|
| 29 | + var tag = window.location.hash.replace("#", "").split('|'); |
| 30 | + var title = tag[0]; |
| 31 | + var password = tag[1]; |
| 32 | + if (title) {{ |
| 33 | + $('.wrapper').prepend('<h3>[FeedCrawler Helper] ' + title + '</h3>'); |
| 34 | + $(".container").hide(); |
| 35 | + var checkExist = setInterval(async function () {{ |
| 36 | + if ($("tr:contains('" + title + "')").length) {{ |
| 37 | + $(".container").show(); |
| 38 | + $("tr:contains('" + title + "')")[0].lastChild.firstChild.click(); |
| 39 | + clearInterval(checkExist); |
| 40 | + }} |
| 41 | + }}, 100); |
| 42 | + }}""" |
| 43 | + |
| 44 | + |
| 45 | +def get_feedcrawler_sponsors_helper_sj(sj, dj, local_address): |
| 46 | + return f"""// ==UserScript== |
| 47 | + // @name FeedCrawler Sponsors Helper (SJ/DJ) |
| 48 | + // @version 0.5.2 |
| 49 | + // @description Clicks the correct download button on SJ/DJ sub pages to speed up Click'n'Load |
| 50 | + // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js |
| 51 | + // @match https://{sj}/* |
| 52 | + // @match https://{dj}/* |
| 53 | + // @exclude https://{sj}/serie/search?q=* |
| 54 | + // @exclude https://{dj}/serie/search?q=* |
| 55 | + // @grant window.close |
| 56 | + // ==/UserScript== |
| 57 | +
|
| 58 | + // Hier muss die von außen erreichbare Adresse des FeedCrawlers stehen (nicht bspw. die Docker-interne): |
| 59 | + const sponsorsURL = '{local_address}'; |
| 60 | + // Hier kann ein Wunschhoster eingetragen werden (ohne www. und .tld): |
| 61 | + const sponsorsHoster = ''; |
| 62 | +
|
| 63 | + $.extend($.expr[':'], {{ |
| 64 | + 'containsi': function(elem, i, match, array) {{ |
| 65 | + return (elem.textContent || elem.innerText || '').toLowerCase() |
| 66 | + .indexOf((match[3] || "").toLowerCase()) >= 0; |
| 67 | + }} |
| 68 | + }}); |
| 69 | +
|
| 70 | + document.body.addEventListener('mousedown', function (e) {{ |
| 71 | + if (e.target.tagName != "A") return; |
| 72 | + var anchor = e.target; |
| 73 | + if (anchor.href.search(new RegExp('{sj}/serie//i')) != -1) {{ |
| 74 | + anchor.href = anchor.href + '#' + anchor.text; |
| 75 | + }} else if (anchor.href.search(new RegExp('{dj}/serie//i')) != -1) {{ |
| 76 | + anchor.href = anchor.href + '#' + anchor.text; |
| 77 | + }} |
| 78 | + }}); |
| 79 | +
|
| 80 | + const tag = window.location.hash.replace("#", "").split('|'); |
| 81 | + const title = tag[0]; |
| 82 | + const password = tag[1]; |
| 83 | + if (title && title !== "login") {{ |
| 84 | + $('.wrapper').prepend('<h3>[FeedCrawler Sponsors Helper] ' + title + '</h3>'); |
| 85 | + $(".container").hide(); |
| 86 | + let i = 0; |
| 87 | + const checkExist = setInterval(function () {{ |
| 88 | + i++; |
| 89 | + if ($("tr:contains('" + title + "')").length) {{ |
| 90 | + $(".container").show(); |
| 91 | + $("tr:contains('" + title + "')")[0].lastChild.firstChild.click(); |
| 92 | + if (i > 24) {{ |
| 93 | + const requiresLogin = $(".alert-warning").length; |
| 94 | + if (requiresLogin) {{ |
| 95 | + console.log("[FeedCrawler Sponsors Helper] Login required for: " + title); |
| 96 | + clearInterval(checkExist); |
| 97 | + window.open("https://" + $(location).attr('hostname') + "#login|" + btoa(window.location)); |
| 98 | + window.close(); |
| 99 | + }} |
| 100 | + clearInterval(checkExist); |
| 101 | + }} else {{ |
| 102 | + console.log("miss") |
| 103 | + }} |
| 104 | + }} |
| 105 | + }}, 100); |
| 106 | +
|
| 107 | + let j = 0; |
| 108 | + let dl = false; |
| 109 | + const dlExists = setInterval(function () {{ |
| 110 | + j++; |
| 111 | + if ($("tr:contains('Download Part')").length) {{ |
| 112 | + const items = $("tr:contains('Download Part')").find("a"); |
| 113 | + const links = []; |
| 114 | + items.each(function (index) {{ |
| 115 | + links.push(items[index].href); |
| 116 | + }}); |
| 117 | + console.log("[FeedCrawler Sponsors Helper] found download links: " + links); |
| 118 | + clearInterval(dlExists); |
| 119 | + window.open(sponsorsURL + '/sponsors_helper/to_download/' + btoa(links + '|' + title + '|' + password)); |
| 120 | + window.close(); |
| 121 | + }} else if (j > 24 && !dl) {{ |
| 122 | + if (sponsorsHoster && $("button:containsi('" + sponsorsHoster + "')").length) {{ |
| 123 | + $("button:containsi('" + sponsorsHoster + "')").click(); |
| 124 | + }} else if ($("button:containsi('1fichier')").length) {{ |
| 125 | + $("button:containsi('1fichier')").click(); |
| 126 | + }} else if ($("button:containsi('ddownload')").length) {{ |
| 127 | + $("button:containsi('ddownload')").click(); |
| 128 | + }} else if ($("button:containsi('turbo')").length) {{ |
| 129 | + $("button:containsi('turbo')").click(); |
| 130 | + }} else if ($("button:containsi('filer')").length) {{ |
| 131 | + $("button:containsi('filer')").click(); |
| 132 | + }} else {{ |
| 133 | + $("div.modal-body").find("button.btn.btn-secondary.btn-block").click(); |
| 134 | + }} |
| 135 | + console.log("[FeedCrawler Sponsors Helper] Clicked Download button to trigger reCAPTCHA"); |
| 136 | + dl = true; |
| 137 | + }} |
| 138 | + }}, 100); |
| 139 | + }}""" |
| 140 | + |
| 141 | + |
| 142 | +def get_feedcrawler_sponsors_helper_fc(fx, sf, local_address): |
| 143 | + return f"""// ==UserScript== |
| 144 | + // @name FeedCrawler Sponsors Helper (FC) |
| 145 | + // @author rix1337 |
| 146 | + // @description Forwards Click'n'Load to FeedCrawler |
| 147 | + // @version 0.7.4 |
| 148 | + // @match *.filecrypt.cc/* |
| 149 | + // @match *.filecrypt.co/* |
| 150 | + // @match *.filecrypt.to/* |
| 151 | + // @exclude http://filecrypt.cc/helper.html* |
| 152 | + // @exclude http://filecrypt.co/helper.html* |
| 153 | + // @exclude http://filecrypt.to/helper.html* |
| 154 | + // @grant window.close |
| 155 | + // ==/UserScript== |
| 156 | +
|
| 157 | + // Hier muss die von außen erreichbare Adresse des FeedCrawlers stehen (nicht bspw. die Docker-interne): |
| 158 | + const sponsorsURL = '{local_address}'; |
| 159 | + // Hier kann ein Wunschhoster eingetragen werden (ohne www. und .tld): |
| 160 | + const sponsorsHoster = ''; |
| 161 | +
|
| 162 | + const tag = window.location.hash.replace("#", "").split('|'); |
| 163 | + const title = tag[0]; |
| 164 | + const password = tag[1]; |
| 165 | + const ids = tag[2]; |
| 166 | + const urlParams = new URLSearchParams(window.location.search); |
| 167 | +
|
| 168 | + function Sleep(milliseconds) {{ |
| 169 | + return new Promise(resolve => setTimeout(resolve, milliseconds)); |
| 170 | + }} |
| 171 | +
|
| 172 | + let pw = ""; |
| 173 | +
|
| 174 | + let fx = false; |
| 175 | + try {{ |
| 176 | + fx = (document.getElementById("customlogo").getAttribute('src') === '/css/custom/f38ed.png') |
| 177 | + }} catch {{}} |
| 178 | +
|
| 179 | + const checkPass = setInterval(function () {{ |
| 180 | + if (document.getElementById("p4assw0rt")) {{ |
| 181 | + if (password) {{ |
| 182 | + pw = password; |
| 183 | + }} else if (fx) {{ |
| 184 | + pw = '{fx.split('.')[0]}'; |
| 185 | + }} else {{ |
| 186 | + pw = '{sf}'; |
| 187 | + }} |
| 188 | + }} else {{ |
| 189 | + pw = ""; |
| 190 | + }} |
| 191 | + clearInterval(checkPass); |
| 192 | + }}, 100); |
| 193 | +
|
| 194 | + const enterPass = setInterval(function () {{ |
| 195 | + if (pw) {{ |
| 196 | + console.log("[FeedCrawler Sponsors Helper] entering Password: " + pw); |
| 197 | + try {{ |
| 198 | + document.getElementById("p4assw0rt").value = pw; |
| 199 | + document.getElementById("p4assw0rt").parentNode.nextElementSibling.click(); |
| 200 | + }} catch (e) {{ |
| 201 | + console.log("[FeedCrawler Sponsors Helper] Password set Error: " + e); |
| 202 | + }} |
| 203 | + clearInterval(enterPass); |
| 204 | + }} |
| 205 | + }}, 100); |
| 206 | +
|
| 207 | + const checkAd = setInterval(function () {{ |
| 208 | + if (document.querySelector('#cform > div > div > div > div > ul > li:nth-child(2)') !== null) {{ |
| 209 | + document.querySelector('#cform > div > div > div > div > ul > li:nth-child(2)').style.display = 'none'; |
| 210 | + clearInterval(checkAd); |
| 211 | + }} |
| 212 | + }}, 100); |
| 213 | +
|
| 214 | + let mirrorsAvailable = false; |
| 215 | + try {{ |
| 216 | + mirrorsAvailable = document.querySelector('.mirror').querySelectorAll("a"); |
| 217 | + }} catch {{}} |
| 218 | + let cnlAllowed = false; |
| 219 | +
|
| 220 | + if (mirrorsAvailable && sponsorsHoster) {{ |
| 221 | + const currentURL = window.location.href; |
| 222 | + let desiredMirror = ""; |
| 223 | + let i; |
| 224 | + for (i = 0; i < mirrorsAvailable.length; i++) {{ |
| 225 | + if (mirrorsAvailable[i].text.includes(sponsorsHoster)) {{ |
| 226 | + let ep = ""; |
| 227 | + const cur_ep = urlParams.get('episode'); |
| 228 | + if (cur_ep) {{ |
| 229 | + ep = "&episode=" + cur_ep; |
| 230 | + }} |
| 231 | + desiredMirror = mirrorsAvailable[i].href + ep + window.location.hash; |
| 232 | + }} |
| 233 | + }} |
| 234 | +
|
| 235 | + if (desiredMirror) {{ |
| 236 | + if (!currentURL.toLowerCase().includes(desiredMirror.toLowerCase())) {{ |
| 237 | + console.log("[FeedCrawler Sponsors Helper] switching to desired Mirror: " + sponsorsHoster); |
| 238 | + window.location = desiredMirror; |
| 239 | + }} else {{ |
| 240 | + console.log("[FeedCrawler Sponsors Helper] already at the desired Mirror: " + sponsorsHoster); |
| 241 | + cnlAllowed = true; |
| 242 | + }} |
| 243 | + }} else {{ |
| 244 | + console.log("[FeedCrawler Sponsors Helper] desired Mirror not available: " + sponsorsHoster); |
| 245 | + cnlAllowed = true; |
| 246 | + }} |
| 247 | + }} else {{ |
| 248 | + cnlAllowed = true; |
| 249 | + }} |
| 250 | +
|
| 251 | + const cnlExists = setInterval(async function () {{ |
| 252 | + if (cnlAllowed && document.getElementsByClassName("cnlform").length) {{ |
| 253 | + clearInterval(cnlExists); |
| 254 | + document.getElementById("cnl_btn").click(); |
| 255 | + console.log("[FeedCrawler Sponsors Helper] attempting Click'n'Load"); |
| 256 | + await Sleep(10000); |
| 257 | + window.close(); |
| 258 | + }} |
| 259 | + }}, 100);""" |
| 260 | + |
| 261 | + |
| 262 | +def get_feedcrawler_sponsors_helper_nx(nx, local_address): |
| 263 | + return f"""// ==UserScript== |
| 264 | + // @name FeedCrawler Sponsors Helper (NX) |
| 265 | + // @author rix1337 |
| 266 | + // @description Forwards decrypted links to FeedCrawler |
| 267 | + // @version 0.1.1 |
| 268 | + // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js |
| 269 | + // @match https://{nx}/release/* |
| 270 | + // @grant window.close |
| 271 | + // ==/UserScript== |
| 272 | + // Hier muss die von außen erreichbare Adresse des FeedCrawlers stehen (nicht bspw. die Docker-interne): |
| 273 | + const sponsorsURL = '{local_address}'; |
| 274 | +
|
| 275 | + function Sleep(milliseconds) {{ |
| 276 | + return new Promise(resolve => setTimeout(resolve, milliseconds)); |
| 277 | + }} |
| 278 | +
|
| 279 | + var tag = window.location.hash.replace("#", "").split('|'); |
| 280 | + var title = tag[0]; |
| 281 | + var password = '{nx}'; |
| 282 | +
|
| 283 | + if (title) {{ |
| 284 | + await Sleep(3000); |
| 285 | + $('h2').prepend('<h3>[FeedCrawler Sponsors Helper] ' + title + '</h3>'); |
| 286 | + var dl = false; |
| 287 | + var dlExists = setInterval(function() {{ |
| 288 | + console.log($("tr:contains("+ title +")").find("a[href*=filer]").length) |
| 289 | + if ($("tr:contains("+ title +")").find("a[href*=filer]").length) {{ |
| 290 | + var link = $("tr:contains("+ title +")").find("a[href*=filer]")[0]["href"].replace("https://referer.to/?", ""); |
| 291 | + var links = [link]; |
| 292 | + console.log("[FeedCrawler Sponsors Helper] found download links: " + links); |
| 293 | + clearInterval(dlExists); |
| 294 | + window.open(sponsorsURL + '/sponsors_helper/to_download/' + btoa(links + '|' + title + '|' + password)); |
| 295 | + window.close(); |
| 296 | + }} |
| 297 | + }}, 1000); |
| 298 | + var tolinkExists = setInterval(function() {{ |
| 299 | + console.log($("tr:contains("+ title +")").find("a[href*=tolink]").length) |
| 300 | + if ($("tr:contains("+ title +")").find("a[href*=tolink]").length) {{ |
| 301 | + var link = $("tr:contains("+ title +")").find("a[href*=tolink]")[0]["href"].replace("https://referer.to/?", ""); |
| 302 | + var links = [link]; |
| 303 | + console.log("[FeedCrawler Sponsors Helper] found encrypted download links: " + links); |
| 304 | + clearInterval(tolinkExists); |
| 305 | + window.open(sponsorsURL + '/sponsors_helper/replace_decrypt/' + btoa(links + '|' + title + '|' + password)); |
| 306 | + window.close(); |
| 307 | + }} |
| 308 | + }}, 1000); |
| 309 | + }}""" |
0 commit comments