✨TvTime✨

TvTime à changer son site pour le moment cette ce script va être temporèrement imcomplet en attendant de trouver oui solution durable. 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*. Compatible JDownloader*. NOTE debug: réautoriser les Fénêtres contextuelles/redirection si plusieurs fenêtres ne s'ouvre plus*. *=voir images

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