Show/Click favorite host links - wawacity

Facilite l'ajoute d'épisodes de séries dans JDownloader (Lire la description détaillée)

  1. // ==UserScript==
  2. // @name Show/Click favorite host links - wawacity
  3. // @namespace Violentmonkey Scripts
  4. // @license MIT
  5. // @match https://www.wawacity.*/
  6. // @grant none
  7. // @version 1.1
  8. // @author ConnorMcLeod
  9. // @description Facilite l'ajoute d'épisodes de séries dans JDownloader (Lire la description détaillée)
  10. // ==/UserScript==
  11.  
  12. favoriteHost = '1fichier';
  13. // favoriteHost = 'Fikper';
  14. // favoriteHost = 'Rapidgator';
  15. // favoriteHost = 'Turbobit';
  16. // favoriteHost = 'Nitroflare';
  17.  
  18. copyLinksInterval = 0;
  19. clickedButtons = [];
  20.  
  21. if (document.location.search.startsWith('?p=serie&id=')) {
  22. const selector = document.querySelector("#DDLLinks");
  23. const links = selector.getElementsByClassName('link-row');
  24.  
  25. for (let elt of links) {
  26. if (elt.textContent.includes(favoriteHost)) {
  27. elt.style.display = '';
  28. }
  29. }
  30.  
  31. enableClick();
  32.  
  33. if (!copyLinksInterval) {
  34. copyLinksInterval = setInterval(function() {
  35. const button = Array.from(document.getElementsByClassName('btn-copy-clipboard')).filter(e => !e.disabled).at(0);
  36. if (button) {
  37. button.focus();
  38. navigator.clipboard.writeText(button.getAttribute('data-href'))
  39. .then(() => {
  40. button.remove();
  41. // })
  42. // .catch((error) => {
  43. // alert(error);
  44. });
  45. }
  46. }, 500);
  47. }
  48. } else if (copyLinksInterval) {
  49. clearInterval(copyLinksInterval);
  50. copyLinksInterval = 0;
  51. clickedButtons = [];
  52. }
  53.  
  54. function enableClick() {
  55. const title = document.title.slice(0, -(" gratuitement sur Wawacity").length);
  56. const block = Array.from(document.getElementsByClassName("fa-play-circle")).map(x => x.parentNode).filter(e => e.innerText.includes(title))[0];
  57.  
  58. const button = document.createElement("button");
  59. button.type = 'button';
  60. button.setAttribute('style', 'background-color: rgb(37 99 235);color: white;border: 0px;margin-left: 6px;border-radius: 6px;');
  61. button.append(`Récupérer toutes les url ${favoriteHost}`);
  62.  
  63. const dlAll = () => {
  64. if (confirm(`Cliquer sur tous les liens ${favoriteHost} ?`)) {
  65. buttons = document.getElementsByTagName("button");
  66. correctButtons = Array.from(buttons).reverse().filter(e => [e.textContent, e.innerText].includes(`Récupérer l'URL : ${favoriteHost}`));
  67. setTimeout(function clicButton() {
  68. for (let i = 0; i < correctButtons.length; i++) {
  69. const btn = correctButtons[i];
  70. if (!clickedButtons.includes(btn)) {
  71. clickedButtons.push(btn);
  72. btn.click();
  73. if (i < correctButtons.length - 1) {
  74. setTimeout(clicButton, 1100);
  75. }
  76. break;
  77. }
  78. }
  79. }, 1100);
  80. button.remove();
  81. }
  82. };
  83.  
  84. button.onclick = dlAll;
  85. block.appendChild(button);
  86. }