IMX.TO Direktlink on GirlsReleased

Replaces Image URIs on GirlsReleased with direct links to the image files on imx.to, imagetwist.com, imgadult.com or pixhost.to

  1. // ==UserScript==
  2. // @name IMX.TO Direktlink on GirlsReleased
  3. // @name:de Direkte Bildlinks auf Girlsreleased.com
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.8
  6. // @description Replaces Image URIs on GirlsReleased with direct links to the image files on imx.to, imagetwist.com, imgadult.com or pixhost.to
  7. // @description:de Ersetzt die Bild-Links auf GirlsReleased mit direkten Links zu den Bilddateien auf imx.to, imagetwist.com, imgadult.com oder pixhost.to
  8. // @author Christian Schmidt
  9. // @match https://girlsreleased.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=girlsreleased.com
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const urlpart = '.imx.to/i/';
  19. const auswahl = document.createElement('div');
  20. const imxtoptn = /imx\.to/;
  21. const imgtwistptn = /imagetwist\.com/;
  22. const imgtwistbigjpg = /\.JPG/;
  23. const imgadultptn = /imgadult\.com/;
  24. const pixhostptn = /pixhost\.to/;
  25. auswahl.style.fontSize = '0.7em';
  26. auswahl.style.padding = '.5em';
  27. auswahl.classList.add("w-full", "fixed");
  28. auswahl.style.top = '4rem';
  29. let awcode = '<form id="imxtoauswahl" style="min-width:500px"><label for="imxtoselect">imx.to image server:</label><select name="imxtoselect" id="imxtoselect" size="1"><option value="i" selected>i</option>';
  30. for (let i = 1; i < 10; i++) {
  31. awcode += '<option value="i00'+i+'">i00'+i+'</option>';
  32. }
  33. awcode += '</select>.imx.to <button id="imxtoselectbtn" type="button">Convert hyperlinks</button></form>';
  34. auswahl.innerHTML = awcode;
  35. setTimeout(() => {
  36. const ads = document.querySelectorAll('.ad-banner');
  37. ads.forEach(ad => {
  38. ad.remove();
  39. });
  40. const content = document.querySelector('.content');
  41. const par = content.parentNode;
  42. par.insertBefore(auswahl, content);
  43.  
  44. const awbutton = document.getElementById("imxtoselectbtn");
  45. if (awbutton != null) {
  46. awbutton.addEventListener("click", function(e) {
  47. e.preventDefault();
  48. const aw = document.getElementById("imxtoselect").value;
  49. if (!aw) return;
  50. let servername = aw + urlpart;
  51. let thumblist = document.querySelectorAll('.images .imageContainer .image');
  52. if (thumblist.length == 0) return;
  53. [...thumblist].forEach(ele => {
  54. const a = ele.querySelector('a');
  55. const img = ele.querySelector('img');
  56. const thumbimgsrc = img.src;
  57.  
  58. if (imxtoptn.test(thumbimgsrc)) {
  59. const neubildsrc = thumbimgsrc.replace('https://imx.to/u/t/', 'https://' + servername);
  60. a.href = neubildsrc;
  61. let bgcolor = 'PowderBlue';
  62. switch (aw) {
  63. case 'i001': bgcolor = 'AliceBlue'; break;
  64. case 'i002': bgcolor = 'Azure'; break;
  65. case 'i003': bgcolor = 'PaleTurquoise'; break;
  66. default: bgcolor = 'PowderBlue'; break;
  67. }
  68. ele.style.backgroundColor = bgcolor;
  69. }
  70. if (imgtwistptn.test(thumbimgsrc)) {
  71. let neubildsrc = thumbimgsrc;
  72. if (imgtwistbigjpg.test(img.alt)) {
  73. neubildsrc = neubildsrc.replace('.jpg', '.JPG');
  74. }
  75. neubildsrc = neubildsrc.replace('imagetwist.com/th/', 'imagetwist.com/i/') + '/' + img.alt;
  76. a.href = neubildsrc;
  77. ele.style.backgroundColor = 'Lavender';
  78. }
  79. if (imgadultptn.test(thumbimgsrc)) {
  80. let neubildsrc = thumbimgsrc;
  81. neubildsrc = neubildsrc.replace('small-medium/', 'big/');
  82.  
  83. a.href = neubildsrc;
  84. ele.style.backgroundColor = 'SeaShell';
  85. }
  86. if (pixhostptn.test(thumbimgsrc)) {
  87. let neubildsrc = thumbimgsrc;
  88. neubildsrc = neubildsrc.replace('https://t', 'https://img');
  89. neubildsrc = neubildsrc.replace('/thumbs/', '/images/');
  90. a.href = neubildsrc;
  91. ele.style.backgroundColor = 'HoneyDew';
  92. }
  93. });
  94. });
  95. }
  96. }, 1000);
  97. })();