✨TvTime✨

Trouver vos séries, manga, documentaire, émission... depuis tvtime.com: (⟳) vérifie si vos saisons sont completes, 🔍 pour trouver votre serie. Un Bouton [Réglage] sauvegardera vos préférence au file des mise à jours (voir images). Compatible JDownloader.

目前为 2023-09-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ✨TvTime✨
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6.8
  5. // @description Trouver vos séries, manga, documentaire, émission... depuis tvtime.com: (⟳) vérifie si vos saisons sont completes, 🔍 pour trouver votre serie. Un Bouton [Réglage] sauvegardera vos préférence au file des mise à jours (voir images). Compatible JDownloader.
  6. // @license MIT
  7. // @author DEV314R
  8. // @match https://www.tvtime.com/fr
  9. // @match https://www.tvtime.com/fr/*
  10. // @match https://www.tvtime.com/*/to-watch
  11. // @match https://dl-protect.link/*
  12. // @match https://www.zone-telechargement.pink/*
  13. // @icon https://external-content.duckduckgo.com/ip3/www.tvtime.com.ico
  14. // @run-at document-start
  15. // @grant GM_addStyle
  16. // @grant GM.setClipboard
  17. // @grant window.close
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // ==/UserScript==
  21. const choixServeurOptions=['Uptobox','1fichier','Fikper','Rapidgator','Turbobit','Nitroflare','Netu','Vidoza','Doodstream'];
  22.  
  23. const variables=[
  24. {name:'juste',label:'Series complètes: ',defaultValue:'activer'},
  25. {name:'jour',label:'Jour après sortie: ',defaultValue:'0'},
  26. { name: 'hébergeur', label: "Choix d'hébergeur: ", defaultValue: choixServeurOptions[1] },
  27. { name: 'Temp', label: 'Temp (en ms) par ouverture de lien: ', defaultValue: '8000' },
  28. { name: 'JDownloader', label: 'Liens vers JDownloader: ', defaultValue: 'désactiver' },
  29. { name: 'ConfirmerRecherche', label: 'Recherche rapide: ', defaultValue: 'désactiver' }
  30. ];
  31.  
  32. const juste=GM_getValue('juste', variables.find(v => v.name === 'juste').defaultValue);
  33. const jour=GM_getValue('jour', variables.find(v => v.name === 'jour').defaultValue);
  34. const hébergeur=GM_getValue('hébergeur', variables.find(v => v.name === 'hébergeur').defaultValue);
  35. const Temp=GM_getValue('Temp', variables.find(v => v.name === 'Temp').defaultValue);
  36. const JDownloader=GM_getValue('JDownloader', variables.find(v => v.name === 'JDownloader').defaultValue);
  37. const ConfirmerRecherche=GM_getValue('ConfirmerRecherche', variables.find(v => v.name === 'ConfirmerRecherche').defaultValue);
  38.  
  39.  
  40. if(location.href.search(/www.tvtime.com/gi)>-1){GM_addStyle(`
  41. section{padding:0;margin:0}
  42. html,.alt-block,#content,section,.row,.body-inner,ul.dropdown-menu,.scrollable,.right{color:#ddd!important;background:#000!important;}
  43. .credits > p,.social,#get-the-app{display:none;}
  44. #home {color:#ddd;background:#fbd737;}
  45. h3,.label,.expand-icon{color:#fbd737!important;}
  46. .label :hover,[data-toggle] :hover{color:#000!important;background:#fbd737;}
  47. .rank-sticker{color:#000!important;}
  48. span,h2{color:#fff!important;}
  49. #profile,#to-watch,.main-block{color:#ddd;background:#222;}
  50. h1,h2 a{color:#ddd!important;}
  51. .posters-list>li .poster-details .secondary-link{color:#888}
  52. .dropdown{background:#1a1a1a!important;}
  53. #episode-details.episode.episode-header.banner.change-episode-link{
  54. width: 43%;
  55. border: 0.1vw solid #fbd737!important;}
  56. #actor-discussion .filters, #profile-discussion .filters, #profile-shows #favorite-shows .progress, #profile-shows #favorite-shows h3, #profile-shows .labels h4, #profile-shows .posters-list>li .poster-details h3 {
  57. display: block;color: #7cdb62!important;}
  58. .odd *{background:#212121!important;}
  59. `)}
  60. if(location.href.search(/\.zone-telechargement\./gi)>-1){GM_addStyle(`
  61. body,#header,b,.top-title,[class*="content"],.blockbox,ul li,[style] a,div.message_box.berrors,.container,.s_mid,.s_left,.top-year,.imdbRating,.cover_global,.maincont,.blocks{color:#dfdfdf!important;background:#000!important;border-color:#000;}
  62. button,img,[src]{color:#000!important;background:#eee!important;}
  63. .quote,[name="search"]{color:#bbb!important;background:#333!important;}
  64. div,p,table,td,blockquote,li,ul{padding-top:0!important;margin-top:0!important;margin-bottom: 0!important;}
  65. #header,#sidebar-right > div:last-child,#dle-content > div.blockbox > div.blockcontent > div:not(.upload-infos){display: none!important;}
  66. a[href*='-vostfr-720p.html'],a[href*='-vostfr-1080p.html'],a[href*='/vostfr/'],a[href*='-vostfr.html'],[class*="prez"],[title*="Télécharger "],[title*="Regarder "]{display:none!important}
  67. `)}
  68.  
  69. document.addEventListener('DOMContentLoaded',()=>{
  70. if(location.href.search(/www.tvtime.com/gi)>-1){
  71.  
  72. const site="www.zone-telechargement.pink/?p=series&search="
  73.  
  74. function createInput(variable) {
  75. const container = document.createElement('div');
  76. const label = document.createElement('label');
  77. label.textContent = variable.label;
  78.  
  79. let input;
  80.  
  81. if (variable.name === 'jour' || variable.name === 'Temp') {
  82. input = document.createElement('input');
  83. input.type = 'text';
  84. input.value = GM_getValue(variable.name, variable.defaultValue);
  85. input.addEventListener('input', function() {
  86. input.value = input.value.replace(/\D/g, ''); // Retirer tous les caractères non numériques
  87. GM_setValue(variable.name, input.value);
  88. });
  89. } else if (variable.name === 'hébergeur') {
  90. input = document.createElement('select');
  91. for (const option of choixServeurOptions) {
  92. const optionElement = document.createElement('option');
  93. optionElement.value = option;
  94. optionElement.textContent = option;
  95. input.appendChild(optionElement);
  96. }
  97.  
  98. input.value = GM_getValue(variable.name, variable.defaultValue);
  99. input.addEventListener('change', function() {
  100. GM_setValue(variable.name, input.value);
  101. });
  102. } else {
  103. input = document.createElement('select');
  104. const options = ['activer', 'désactiver'];
  105. for (const option of options) {
  106. const optionElement = document.createElement('option');
  107. optionElement.value = option;
  108. optionElement.textContent = option;
  109. input.appendChild(optionElement);
  110. }
  111.  
  112. input.value = GM_getValue(variable.name, variable.defaultValue);
  113. input.addEventListener('change', function() {
  114. GM_setValue(variable.name, input.value);
  115. });
  116. }
  117.  
  118. container.appendChild(label);
  119. container.appendChild(input);
  120.  
  121. return container;
  122. }
  123.  
  124. function createSettingsButton() {
  125. const button = document.createElement('button');
  126. button.textContent = 'Réglages';
  127. button.style.position = 'fixed';
  128. button.style.bottom = '0.1em';
  129. button.style.left = '0.1em';
  130. button.style.color = '#000';
  131. button.style.backgroundColor = '#ffd700';
  132. button.style.zIndex = "1000";
  133. button.addEventListener('click', function() {
  134. const settingsPopup = document.createElement('div');
  135. settingsPopup.style.position = 'fixed';
  136. settingsPopup.style.bottom = '0';
  137. settingsPopup.style.left = '0';
  138. settingsPopup.style.padding = '0.4em';
  139. settingsPopup.style.backgroundColor = '#ffd700';
  140. settingsPopup.style.zIndex = "1000";
  141.  
  142. for (const variable of variables) {
  143. settingsPopup.appendChild(createInput(variable));
  144. }
  145.  
  146. const closeButton = document.createElement('span');
  147. closeButton.textContent = '❌';
  148. closeButton.style.position = 'absolute';
  149. closeButton.style.bottom = '9.97em';//11.9em
  150. closeButton.style.left = '26.19em';//28.07em
  151. closeButton.style.cursor = 'pointer';
  152. closeButton.style.padding = '0.2em';
  153. closeButton.style.backgroundColor = '#000';
  154. closeButton.addEventListener('click', function() {
  155. document.body.removeChild(settingsPopup);
  156. });
  157. settingsPopup.appendChild(closeButton);
  158.  
  159. document.body.appendChild(settingsPopup);
  160. });
  161.  
  162. document.body.appendChild(button);
  163. }
  164. createSettingsButton();
  165.  
  166.  
  167. let ed;
  168. const cl=document.querySelectorAll('.episode-details.poster-details > a');
  169. for(let g=0;g<cl.length;g++) {
  170. const s=cl[g];
  171. if(ConfirmerRecherche=='activer'){
  172. ed=s.innerText.replace(/ 🔍|\(.+\)/gi, '+')+s.previousElementSibling.querySelector('a').innerText.replace(/S(\d+)E\d+/, (match, saison) => ` - Saison ${parseInt(saison, 10)}`)
  173. }else{
  174. ed=s.innerText.replace(/ 🔍|\(.+\)/gi, '+')//.replace(/[,:].*[^.,:]+/g, "").replace(/[,:!]/g, "")
  175. }
  176. s.parentNode.parentNode.querySelector(":not(.show-all)").innerHTML+=`<a style="border: 0.2em ridge #ffd700; border-radius: 20%; z-index:99999;" target="_blank" href="https://${site}${ed}">🔍</a>`;
  177. }
  178.  
  179. const OnEvent = (doc) => {
  180. return {
  181. on: (type, selector, callback) => {
  182. doc.addEventListener(type, (event) => {
  183. if (!event.target.matches(selector)) return;
  184. callback.call(event.target, event);
  185. }, false);
  186. }
  187. };
  188. };
  189.  
  190. OnEvent(document).on('click', '#rech', () => {re();});
  191.  
  192. // Sélectionnez tous les éléments a qui correspondent aux sélecteurs donnés
  193. const a = document.querySelectorAll(".episode-details.poster-details > a[href],#all-shows > section > ul> li > div > div > h2 >a");
  194. let k = 0;
  195.  
  196. // Fonction pour effectuer la recherche pour un numéro donné
  197. async function recherche(num) {
  198. const s = a[num];
  199. const url = s.href;
  200. const dd = s;
  201. const da = new Date().valueOf();
  202.  
  203. // Créez une nouvelle instance de XMLHttpRequest
  204. const xhr = new XMLHttpRequest();
  205. xhr.open("GET", url, true);
  206. xhr.responseType = "document";
  207.  
  208. // Attendez le chargement de la réponse
  209. xhr.onload = function () {
  210. if (xhr.readyState == 4 && xhr.status == 200) {
  211. // Récupérez la date de sortie de l'épisode
  212. const response = xhr.responseXML.querySelector('.season-content.active > ul > li:last-child > div > div > a > .episode-air-date');
  213. const db = new Date(response.textContent.match(/\d\d\d\d-\d\d-\d\d/gi)[0]).valueOf();
  214.  
  215. if (da >= (db + (jour * 86400000))) {
  216. dd.innerText += '✅';
  217. } else {
  218. if (juste == 'activer') {
  219. dd.parentNode.parentNode.parentNode.removeChild(dd.parentNode.parentNode);
  220. }
  221. dd.innerText += '❌';
  222. dd.innerHTML += ('<br> ' + ((db - da) / 86400000).toFixed(0) + ' jours restants avant sortie complète');
  223. }
  224. dd.innerText += response.innerText;
  225.  
  226. // Récupérez le nombre d'épisodes
  227. const EpisodeMax = xhr.responseXML.querySelectorAll('[itemprop="season"].season-content.active > ul > li').length;
  228. dd.innerHTML += ('<br>nombre d\'épisode: ' + EpisodeMax);
  229. }
  230. };
  231. xhr.send();
  232. }
  233.  
  234. // Fonction re optimisée
  235. function re() {
  236. const i = document.querySelector("#rech");
  237. const cl = a.length;
  238. if (k < cl) {
  239. // Utilisation de setTimeout pour créer un délai de 10 millisecondes entre les itérations
  240. setTimeout(async () => {
  241. await recherche(k);
  242. k++;
  243. re(); // Appel récursif pour la prochaine itération
  244. }, 10);
  245. i.value = "⌛";
  246. i.style.background = "#000";
  247. } else if (k === cl) {
  248. i.value = "👌";
  249. i.removeAttribute("id");
  250. }
  251. }
  252.  
  253.  
  254. if(location.href.search(/www.tvtime.com\/.+\/show\//gi)>-1){
  255. const d1=new Date().valueOf();
  256. const d2=new Date(document.querySelector(".season-content.active > ul > li:last-child > div > div > a>.episode-air-date").textContent.match(/\d\d\d\d-\d\d-\d\d/gi)[0]).valueOf();
  257. const e=document.querySelectorAll(".episode-nb-label");
  258.  
  259. const ep=document.querySelectorAll('.watched-btn.active:last-child');const dep=ep[ep.length-1].parentNode.parentNode.parentNode.querySelector('.episode-nb-label').innerText
  260.  
  261. const r= document.title.replace(/TV Time - |\(.+\)/gi, "")+'S'+document.querySelector("#dSeasons").innerText.match(/\d+/)[0]+"E"+dep+'/'+e[e.length-1].innerText
  262. if(d1>=d2){
  263. document.title="✅"+r
  264. } else {
  265. document.title="❌"+r
  266. document.querySelector('.col-sm-2.actions > .row > .active.watched-btn.col-sm-offset-4.col-sm-6 > .icon-tvst-watch').scrollIntoView();
  267. }
  268. if(location.href.search(/www.tvtime.com\/.+\/show\/\d+/gi) > -1) {
  269. const dn=document.querySelector("#top-banner > div > div.info-zone > div > div > h1");
  270. dn.innerHTML+=('<a style="outline:0.1em ridge #ffd700;outline-radius:20%;" href="https://'+site+dn.innerText.replace(/ 🔍|\(.+\)/gi, "")+'" target="_blank">🔍</a>');
  271. }
  272. }else{
  273. document.querySelector("#home-link").insertAdjacentHTML('beforebegin', '<input id="rech" type="button" value="⟳" style="color:#000;background:#ffd700;border: 0.1em solid #ffd700; border-radius:50%;width:2.3em;height:2.3em;"></input><br>');
  274. }
  275.  
  276.  
  277. }else if(location.href.search(/dl-protect.+\//gi)>-1){
  278.  
  279. GM_addStyle(`body,.urls{color:#ddd;background:#000!important;}
  280. #subButton{color:#000;transform: scale(1.5);}
  281. .navbar,.amigo,footer{display:none!important;}`)
  282. if (JDownloader=='activer'){
  283. setTimeout(()=>{
  284. if (document.querySelector('iframe[src*="https://challenges.cloudflare.com"]')){
  285. document.title="⏳"+document.title
  286. document.querySelector("#subButton").click()
  287. document.title="🖱️"+document.title
  288. setTimeout(()=>{document.querySelector('[rel="external nofollow"]').click()},100)
  289. document.addEventListener("visibilitychange", fcliq);
  290. document.querySelector('html,iframe').addEventListener("mouseenter", fcliq);
  291. function fcliq(){
  292. document.title="🤖"+document.title
  293. setTimeout(()=>{document.querySelector("#subButton").click()},100)}
  294. var erreur=document.querySelector("#protected-container > div:nth-child(2) > div > ul > li > a");if(erreur.innerText.search(/invalide/gi)>-1){erreur.click()}
  295. }},4000)
  296. if (!document.querySelector('iframe[src*="https://challenges.cloudflare.com"]')){
  297. var lien=document.querySelector("#protected-container > div > div > ul > li > a[href]").href
  298. GM.setClipboard(lien)
  299. document.title="🧠"+document.title
  300. setTimeout(function f(){window.close(document.URL)},2500)
  301. }
  302. }else{
  303. document.title="⏳"+document.title
  304. setTimeout(()=>{document.querySelector("#subButton").click()
  305. document.title="🖱️"+document.title
  306. },3000)
  307. setTimeout(()=>{document.querySelector('[rel="external nofollow"]').click()},100)
  308. document.addEventListener("visibilitychange", fcliq);
  309. document.querySelector('html,iframe').addEventListener("mouseenter", fcliq);//document.addEventListener("mouseenter", fcliq);
  310. function fcliq(){
  311. document.title="🤖"+document.title
  312. setTimeout(()=>{document.querySelector("#subButton").click()},100)}
  313. var erreur=document.querySelector("#protected-container > div:nth-child(2) > div > ul > li > a");if(erreur.innerText.search(/invalide/gi)>-1){erreur.click()}
  314.  
  315. }
  316.  
  317. }
  318.  
  319. if(location.href.search(/series|mangas/gi)>-1){
  320. //extractContent:
  321. // Sélectionnez tous les liens URL et les éléments cibles
  322. const urlElements = document.querySelectorAll("#dle-content > div:nth-child(n+4) > div:nth-child(4) div div a[href]");
  323. const targetElements = document.querySelectorAll("#dle-content > div:nth-child(n+4) > div:nth-child(4) div div a[href]");
  324. // Utilisez Promise.all avec map pour effectuer les requêtes en parallèle
  325. Promise.all(Array.from(urlElements).map(async (urlElement, i) => {
  326. const url = urlElement.href;
  327. try {
  328. const response = await fetch(url);
  329. const html = await response.text();
  330.  
  331. // Extraction du contenu
  332. const parser = new DOMParser();
  333. const doc = parser.parseFromString(html, "text/html");
  334. const sourceElement = doc.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)");
  335.  
  336. // Extraction du numéro de l'épisode le plus récent
  337. const postinfoText = doc.querySelector("center > .postinfo").innerText;
  338. const dernierepisodeP2 = Math.max(...(postinfoText.match(/\d+/g) || []));
  339.  
  340. // Renvoi du contenu extrait
  341. let innerText = sourceElement.innerText.match(/\d+ Episodes/gi);
  342.  
  343. if (innerText !== null && parseInt(dernierepisodeP2) >= parseInt(innerText[0].match(/\d+/g)[0])) {
  344. // L'épisode est le plus récent, on ajoute un message de mise à jour
  345. innerText = "✅ Complet " + innerText;
  346. } else if (innerText == null) {
  347. innerText = "❗␀ " + innerText;
  348. } else {
  349. // L'épisode est incomplet, on retire l'élément parent de targetElements
  350. targetElements[i].parentElement.parentElement.parentElement.parentElement.remove();
  351. }
  352.  
  353. return {
  354. targetElement: targetElements[i],
  355. innerText: innerText
  356. };
  357. } catch (error) {
  358. console.error("Erreur lors de la récupération des données :", error);
  359. return {
  360. targetElement: targetElements[i],
  361. innerText: "Erreur"
  362. };
  363. }
  364. })).then(results => {
  365. results.forEach(result => {
  366. result.targetElement.innerHTML += "<br>" + result.innerText;
  367. });
  368. });
  369.  
  370. }
  371.  
  372. if(location.href.search(/(serie|manga)&id/gi)>-1){
  373. var t= document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(3)")
  374. var d1=document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)").textContent.match(/\d+(?=\sEpisode)/gi)[0]
  375. var dm=document.querySelector("center > .postinfo").innerText.match(/\d+/gi)
  376. let match= dm.includes(d1)
  377. t.textContent=(match?"✅":"❌")+t.textContent;
  378. if (t.textContent.startsWith("✅")){
  379. //ajouterBoutonTOUTDL:
  380. var elements = document.querySelectorAll('.postinfo div[style*="font-weight:bold;"]');
  381. for (var i = 0; i < elements.length; i++) {
  382. var element = elements[i];
  383. var nom = element.innerText.trim();
  384. element.insertAdjacentHTML('afterbegin', '<a class="tdl-button" style="border: 0.2em ridge #ffd700;padding:0.2em;margin:0.2em;cursor:pointer;"> TOUT DL ' + nom + '</a>');
  385. }
  386.  
  387.  
  388. const buttons = document.querySelectorAll('.tdl-button');
  389.  
  390. var nombretotalepisode = parseInt(document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)").textContent.match(/\d+(?=\sEpisode)/gi));
  391. let ts=document.title.replace(/Télécharger/gi,'').replace(/ - Saison /gi,' S');
  392.  
  393. function openLinksBetween(startButton, endButton) {
  394. const links = document.querySelectorAll('.postinfo a');
  395. const startIndex = Array.from(links).indexOf(startButton);
  396. const endIndex = Array.from(links).indexOf(endButton);
  397. const linksToOpen = Array.from(links).slice(startIndex + 1, endIndex);
  398.  
  399. function openLinksWithDelay(index) {
  400. if (index < linksToOpen.length) {
  401. window.open(linksToOpen[index].href, '_blank');
  402. setTimeout(() => {
  403. openLinksWithDelay(index + 1);
  404. }, Temp);
  405. document.title = (index + 1) + '/' + nombretotalepisode + ts;
  406. }
  407. }
  408.  
  409. openLinksWithDelay(0);
  410. }
  411.  
  412. buttons.forEach((button, index) => {
  413. button.addEventListener('click', () => {
  414. const nextButton = buttons[index + 1] || null;
  415. openLinksBetween(button, nextButton);
  416. });
  417. });
  418. //
  419. }
  420. }
  421. ///////////
  422.  
  423. if(location.href.search(/(serie|manga)&id/gi)>-1){
  424. var siteT="https://www.tvtime.com/fr/"
  425. var noms=document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(3)").innerText
  426. document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(3)").insertAdjacentHTML('beforeend', '<a style="border: 0.2em ridge #ffd700; color:ffd700; background:#000; margin-left:0.6em;" target="_blank" href="'+siteT+'##'+noms.replace(/✅|❌/gi,'')+'">TV Time</a><br>')
  427. }else if (location.href.match(/www.tvtime.com\/fr\/##/gi)>-1){
  428. var recherche=document.querySelector("#global-search-input")
  429. if (location.href.match(/##.+/gi)){
  430. var decodedText = decodeURIComponent(location.href.split("##")[1]);
  431. recherche.value = decodedText;
  432. }
  433. //recherche en cours...
  434. }
  435.  
  436. function site(href){return location.href.search(href)>-1}
  437.  
  438. if (ConfirmerRecherche=='activer'){
  439. if(location.href.search(/zone-telechargement.+(&search|search=)/gi)>-1){retirerNonConformes("#story",".cover_infos_title",3).then(function2);
  440.  
  441. setTimeout(()=>{
  442. document.title="⏳❔"+document.title
  443. if( ( document.querySelector("#dle-content > div:nth-child(4)").innerText.match(/Aucune fiches trouvées/gi)||document.querySelectorAll(".cover_global").length==0 ) && location.href.search(/series/gi)>-1){
  444. window.open(location.href.replace(/series&search/gi,"mangas&search"), "_self");
  445. }else if( ( document.querySelector("#dle-content > div:nth-child(4)").innerText.match(/Aucune fiches trouvé/gi)||document.querySelectorAll(".cover_global").length==0 ) && location.href.search(/mangas/gi)>-1){
  446. window.open(location.href.replace(/mangas&search/gi,"autres-videos&search"), "_self");
  447. }else if( ( document.querySelector("#dle-content > div:nth-child(4)").innerText.match(/Aucune fiches trouvé/gi)||document.querySelectorAll(".cover_global").length==0 ) && location.href.search(/autres-videos/gi)>-1){
  448. document.title="🤷"+document.title
  449. document.querySelector(".centersideinn").innerText="🤷❔Pas trouver"
  450. /*document.querySelector("body").innerText="Pas trouver fermeture dans 5 Seconde"
  451. setTimeout(function f(){window.close(document.URL)},5000)*/
  452.  
  453. }},3000)
  454. }
  455.  
  456. function retirerNonConformes(element,tableau,profondeur) {
  457. return new Promise(resolve=>{
  458. var ele =document.querySelector(element)
  459. var text=ele.value
  460. var eleconvertiregex=new RegExp(text,"gi");
  461. var tableaux=document.querySelectorAll(tableau)
  462. for(var j=0;j<tableaux.length;j++){
  463. if((tableaux[j].innerText.search(eleconvertiregex))>-1){
  464. }else{
  465. var s=tableaux[j];
  466. for(var i=0;i<profondeur;i++){
  467. s=s.parentNode;
  468. }
  469. s.parentNode.removeChild(s);
  470. }}
  471. resolve();
  472. });
  473. }
  474.  
  475. function function2(){
  476. var elem4=document.querySelectorAll("#dle-content > div.cover_global:nth-child(n+5)")
  477. if(elem4.length===1){document.querySelector("#dle-content > div.cover_global:nth-child(5) a").click()
  478. }
  479. }
  480.  
  481. if(location.href.search(/zone-telechargement.+((serie|manga)&id=|search=)/gi)>-1){
  482. //removeLessImportant:
  483. var arr = document.querySelectorAll("#dle-content > div:nth-child(n+5) > div:nth-child(4) > div > div > span > span > b");
  484. let best;
  485. for (let i = 0; i < arr.length; i++) {
  486. if (arr[i].textContent.includes("4K")) {
  487. best = arr[i];
  488. break;
  489. } else if (arr[i].textContent.includes("(VF HD)")) {
  490. if (!best || best.textContent.includes("(VF)")) {
  491. best = arr[i];
  492. }
  493. } else if (arr[i].textContent.includes("(VF)")) {
  494. if (!best) {
  495. best = arr[i];
  496. }
  497. }
  498. }
  499. for (let i = 0; i < arr.length; i++) {
  500. if (arr[i] !== best) {
  501. var s=arr[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
  502. s.parentNode.removeChild(s);
  503. }}
  504. }
  505.  
  506. if(location.href.search(/(serie|manga|film)&id/gi)>-1){clickOnElement2("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)",/vf|720p|HDRIP|BDRIP/gi,"#dle-content > div.base > div > div.corps > div:nth-child(1) > div.otherversions > a > span > span > b",/\(VF HD\)|1080p/gi)}
  507. function clickOnElement2(element1,txt1, element2,txt2) {
  508. if(document.querySelector(element1).innerText.search(txt1)>-1 && document.querySelector(element2).innerText.search(txt2)>-1) {
  509. document.querySelector(element2).click();}
  510. }
  511.  
  512. }
  513.  
  514. //if(site(/&search|\?search=|mangas&(page|genre)/gi)){retirer(4,/ VOSTFR |\(VOSTFR HD\)|\(VOSTFR\)|\(Coréen\)|\(Polonais\)|\(Espagnol\)|\(Anglais\)|\(Japonais\)|HDCAM|\(VO\)|^(HDRiP MD|TS( MD)?)$/gi,"span,a,b");}
  515. function retirer(profondeur,filtre,cible){
  516. var ref=filtre;
  517. var cl=document.querySelectorAll(cible);
  518. for(var k=0;k<cl.length;k++){
  519. var match=false;
  520. if(Array.isArray(ref)){
  521. for(var u=0;u<ref.length;u++){
  522. if(cl[k].innerText.match(ref[u])){
  523. match=true;
  524. break;
  525. }}
  526. }else{
  527. match=cl[k].innerText.match(ref);
  528. }
  529. if(match){
  530. var s=cl[k];
  531. for(var i=0;i<profondeur;i++){
  532. s=s.parentNode;}
  533. s.parentNode.removeChild(s);
  534. }}}
  535.  
  536.  
  537. const heb = new RegExp(hébergeur, "gi");
  538. if(location.href.search(/.zone-telechargement.+p=(films|ebooks)/gi)>-1){
  539.  
  540. async function getExternalLinkFromInternalLink() {
  541. try {
  542. const internalLinks = document.querySelectorAll("div.cover_infos_title > a");
  543. const externalLinks = [];
  544.  
  545. // Loop through each internal link
  546. for (const internalLink of internalLinks) {
  547. const href = internalLink.href;
  548. let externalLink = null;
  549.  
  550. // Ajout du bouton et de l'événement de clic pour ouvrir le lien externe dans un nouvel onglet
  551. const button = document.createElement('nav');
  552. button.textContent = '🔗'+hébergeur;
  553. button.style.position = 'absolute';
  554. button.style.left = '58%';
  555. button.style.top = '8%';
  556. button.style.transform = 'scale(1.25)'
  557. button.style.opacity = '0.75';
  558. button.style.cursor = 'pointer';
  559. button.style.background = '#ffd700';
  560. button.style.color = '#000';
  561. button.style.outline = '0.1em solid #000';
  562. button.style.zIndex = '9999';
  563. internalLink.parentNode.parentNode.parentNode.appendChild(button);
  564.  
  565. button.addEventListener('click', async () => {
  566. if (!externalLink) {
  567. const response = await fetch(href);
  568. if (!response.ok) {
  569. throw new Error('Erreur lors de la récupération du contenu du lien interne.');
  570. }
  571.  
  572. const textContent = await response.text();
  573. const elements = new DOMParser().parseFromString(textContent, 'text/html').querySelectorAll("center > div.postinfo > b > div");
  574. const regex = heb;
  575.  
  576. // Loop through elements to find the external link matching the regex
  577. for (let i = 0; i < elements.length; i++) {
  578. const element = elements[i];
  579. if (element.innerText.match(regex)) {
  580. externalLink = element.parentElement.nextElementSibling.firstChild.href;
  581. break;
  582. }
  583. }
  584. }
  585.  
  586. if (externalLink) {
  587. window.open(externalLink, '_blank');
  588. } else {
  589. console.log('Impossible de récupérer le lien externe.');
  590. }
  591. });
  592.  
  593. externalLinks.push(button);
  594. }
  595.  
  596. return externalLinks; // Returning an array of external link buttons
  597. } catch (error) {
  598. console.error('Une erreur est survenue :', error);
  599. return null;
  600. }
  601. }
  602.  
  603. // Appel de la fonction et récupération du tableau de boutons de liens externes
  604. getExternalLinkFromInternalLink()
  605. .then((externalLinks) => {
  606. if (externalLinks) {
  607. console.log('Boutons de liens externes créés :', externalLinks);
  608. } else {
  609. console.log('Impossible de récupérer les liens externes.');
  610. }
  611. });
  612.  
  613.  
  614. }
  615.  
  616. })