Simple •TvTime➡️(Télécharger🔛Regarder)

À partir du site https://www.tvtime.com/fr vous pourrez avoir cliquer sur 🔍 pour trouver votre serie rapidement pour la regarder ou la télécharger. Autres détails:(Sur TV Time pour vérifie si une saison est completement clicker sur " ⟳ " ). Ajout d'un lien (🔍)et simplification d'utilisation. ET ajout d'un boutton pour "tout dl" pour le premier hébergeur si la saison et complète et autre filtre(type best quality)...)

目前為 2023-02-15 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Simple •TvTime➡️(Télécharger🔛Regarder)
// @namespace    http://tampermonkey.net/
// @version      0.9.7
// @description  À partir du site https://www.tvtime.com/fr vous pourrez avoir cliquer sur 🔍 pour trouver votre serie rapidement pour la regarder ou la télécharger. Autres détails:(Sur TV Time pour vérifie si une saison est completement clicker sur " ⟳ " ). Ajout d'un lien (🔍)et simplification d'utilisation. ET ajout d'un boutton pour "tout dl" pour le premier hébergeur si la saison et complète et autre filtre(type best quality)...)
// @license      MIT
// @author       DEV314R
// @match        https://www.tvtime.com/fr
// @match        https://www.tvtime.com/fr/*
// @match        https://www.tvtime.com/*/to-watch
// @match        https://dl-protect.net/*
// @match        https://www.zone-telechargement.hair/?p=serie&id*
// @match        https://www.zone-telechargement.hair/?p=manga&id*
// @match        https://www.zone-telechargement.hair/?p=series&s*
// @match        https://www.zone-telechargement.hair/?p=mangas&s*
// @match        https://www.zone-telechargement.hair/?p=series&search*
// @match        https://www.zone-telechargement.hair/?p=mangas&search*
// @icon         https://icons.duckduckgo.com/ip2/tvtime.com.ico
// @run-at       document-start
// @grant        GM_addStyle
// @grant        window.close
// ==/UserScript==
if(location.href.search(/www.tvtime.com/gi)>-1){csstime()}
document.addEventListener('DOMContentLoaded',()=>{
if(location.href.search(/www.tvtime.com/gi)>-1){


const juste=1//1=seulement les complète | 0=tous avec indication
const jour=0//jour en décalage par rapport au jour de sortie de la serie

var site="www.zone-telechargement.hair/?p=series&search="


const a = document.querySelectorAll(".episode-details.poster-details > a[href],#all-shows > section > ul> li > div > div > h2 >a");
let k = 0;


const cl=document.querySelectorAll('.episode-details.poster-details > a');
for(let g=0;g<cl.length;g++) {
const s=cl[g];
const ed=s.innerText;
s.parentNode.parentNode.firstElementChild.innerHTML+=`<a style="border: 0.2em ridge #ffd700; border-radius: 20%;" target="_blank" href="https://${site}${ed.replace(/ 🔍|\(.+\)/gi, '+')}">🔍</a>`;
}


function re() {
  const i = document.querySelector("#rech");
  const cl = a.length;
  if (k < cl) {
    setTimeout(async()=>{
      await recherche(k);
      k++;
      re();
    }, 10);

    i.value = "⌛";
    i.style.background = "#000";
  } else if (k === cl) {
    i.value = "👌";
    i.removeAttribute("id");
}}


if(location.href.search(/www.tvtime.com\/.+\/show\//gi)>-1){
  const d1 = new Date().valueOf();
  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();
  if (d1 >= d2) {
    document.title = "✅" + document.title.replace(/TV Time - /gi, "");
  } else {
    document.title = "❌" + document.title.replace(/TV Time - /gi, "");
    document.querySelector('.col-sm-2.actions > .row > .active.watched-btn.col-sm-offset-4.col-sm-6 > .icon-tvst-watch').scrollIntoView();
}
if(location.href.search(/www.tvtime.com\/.+\/show\/\d+/gi) > -1) {
const dn=document.querySelector("#top-banner > div > div.info-zone > div > div > h1");
dn.innerHTML += ('<a style="outline:0.1em ridge #ffd700;outline-radius:20%;" href="https://'+site+dn.innerText.replace(/ 🔍|\(.+\)/gi, "")+'" target="_blank">🔍</a>');
}
}else{
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>');
}

////
const OnEvent=(doc)=>{
 return{
  on:(type,selector,callback)=>{
   doc.addEventListener(type,(event)=>{
    if(!event.target.matches(selector))return;
    callback.call(event.target,event);
    },false);
}}};
OnEvent(document).on('click','#rech',()=>{
re()

})


async function recherche(num) {
    var s = a[num];
    var url = s.href;
    var dd = s;
    var da = new Date().valueOf();
    var xhr = new XMLHttpRequest();
    xhr.open("GET", url, true);
    xhr.responseType = "document";
    xhr.onload = function() {
        if (xhr.readyState == 4 && xhr.status == 200) {
            var response = xhr.responseXML.querySelector('.season-content.active > ul > li:last-child > div > div > a > .episode-air-date');
            var db = new Date(response.textContent.match(/\d\d\d\d-\d\d-\d\d/gi)[0]).valueOf();
            if (da >= (db + (jour * 86400000))) {
                dd.innerText += '✅';
            } else {
                if (juste == 1) {
                    dd.parentNode.parentNode.parentNode.removeChild(dd.parentNode.parentNode);
                }
                dd.innerText += '❌';
                dd.innerHTML += ('<br> ' + ((db - da) / 86400000).toFixed(0) + ' jours restants avant sortie complète');
            }
            dd.innerText += response.innerText;
            var EpisodeMax = xhr.responseXML.querySelectorAll('[itemprop="season"].season-content.active > ul > li').length;
            dd.innerHTML += ('<br>nombre d\'épisode: ' + EpisodeMax);
}
}
xhr.send();
}





}else if(location.href.search(/dl-protect.net/gi)>-1){

GM_addStyle(`body,.urls{color:#ddd;background:#000!important;}
#subButton{color:#000;transform: scale(1.5);}
.navbar,.amigo,footer{display:none!important;}`)
document.title="⏳"+document.title
setTimeout(()=>{document.querySelector("#subButton").click()
document.title="🖱️"+document.title
},2500)
setTimeout(()=>{document.querySelector('[rel="external nofollow"]').click()},100)
let a=document.addEventListener("mouseenter", fcliq);
function fcliq(){
 document.title="🤖"+document.title
 setTimeout(()=>{document.querySelector("#subButton").click()},100)}
 var erreur=document.querySelector("#protected-container > div:nth-child(2) > div > ul > li > a")
 if(erreur.innerText.search(/invalide/gi)>-1){
 erreur.click()
}

}else{
setTimeout(()=>{
if((document.querySelector("#dle-content > div:nth-child(4)").innerText.match(/Aucune fiches trouvé/gi)||!document.querySelector("#dle-content > div:nth-child(5) > div:nth-child(4) > div > div > a")) && location.href.search(/series&search/gi)>-1){
window.open(location.href.replace(/series&search/gi,"mangas&search"), "_self");
}
else if((document.querySelector("#dle-content > div:nth-child(4)").innerText.match(/Aucune fiches trouvé/gi)||!document.querySelector("#dle-content > div:nth-child(5) > div:nth-child(4) > div > div > a")) && location.href.search(/mangas&search/gi)>-1){
setTimeout(()=>{
document.title="🙅"+document.title
 document.querySelector("body").innerText="Pas trouver fermeture dans 5 Seconde"
 setTimeout(function f(){window.close(document.URL)},5000)
},2000)

}},2000)
}

if(location.href.search(/(serie|manga)&id/gi)>-1){
var t= document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(3)")
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]
var d2=document.querySelector(".postinfo > :last-of-type>a").textContent.match(/\d+/gi)[0]
let match= d1==d2;
t.textContent=(match?"✅":"❌")+t.textContent;
if (t.textContent.startsWith("✅")){adjtdl();}
}

if(location.href.search(/zone-telechargement.+(series&search|(serie|manga)&id=|search=)/gi)>-1){removeLessImportant("#dle-content > div:nth-child(n+5) > div:nth-child(4) > div > div > span > span > b");}
function removeLessImportant(arre) {
 var arr = document.querySelectorAll(arre);
    let best;
    for (let i = 0; i < arr.length; i++) {
        if (arr[i].textContent.includes("4K")) {
            best = arr[i];
            break;
        } else if (arr[i].textContent.includes("(VF HD)")) {
            if (!best || best.textContent.includes("(VF)")) {
                best = arr[i];
            }
        } else if (arr[i].textContent.includes("(VF)")) {
            if (!best) {
                best = arr[i];
            }
        }
    }
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== best) {
         var s=arr[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
           s.parentNode.removeChild(s);
}}}


function adjtdl(){
var result = document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)").textContent.match(/\d+(?=\sEpisode)/gi);
var finalResult = result ? parseInt(result[0]) : 0;

const links=document.querySelectorAll(".postinfo > b > a[href]")

var index = 0;

function openLink(){

links[index].click()
index++;
setTimeout(()=>{
if(finalResult>index){
openLink();
}
},700)

}

const OnEvent=(doc)=>{
 return{
  on:(type,selector,callback)=>{
   doc.addEventListener(type,(event)=>{
    if(!event.target.matches(selector))return;
    callback.call(event.target,event);
    },false);
}}};

OnEvent(document).on('click','#tdl',()=>{let a=openLink()})

document.querySelector("center > div > b:nth-child(1) > div").insertAdjacentHTML('afterbegin', '<a id="tdl"; style="border: 0.2em ridge #ffd700;padding:0.2em;margin:0.2em;cursor:pointer;"> TOUS DL </a>');
}


if(location.href.search(/(serie|manga)&id/gi)>-1){
var siteT="https://www.tvtime.com/fr/"
var nom=document.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(3)").innerText
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+'##'+nom.replace(/✅|❌/gi,'')+'">TV Time</a><br>')
}else if (location.href.match(/www.tvtime.com\/fr\/##.+/gi)>-1){
var recherche=document.querySelector("#global-search-input")
if (location.href.match(/##.+/gi)){
var decodedText = decodeURIComponent(location.href.split("##")[1]);
recherche.value = decodedText;
}
//recherche en cours...
}




function extractContent() {
  // Référence pour les URL
  var urlElements = document.querySelectorAll("#dle-content > div:nth-child(n+4) > div:nth-child(4) div div a[href]");
  // Référence pour le contenu à afficher
  var targetElements = document.querySelectorAll("#dle-content > div:nth-child(n+4) > div:nth-child(4) div div a[href]");

  // Conversion de la référence NodeList en un tableau
  urlElements = Array.from(urlElements);
  targetElements = Array.from(targetElements);

  // Génération d'un tableau de promesses qui exécutent la récupération du contenu à partir de l'URL
  var promises = urlElements.map(function(urlElement, i) {
    var url = urlElement.href;

    return fetch(url)
      .then(function(response) {
        return response.text();
      })
      .then(function(html) {
        // Extraction du contenu
        var parser = new DOMParser();
        var doc = parser.parseFromString(html, "text/html");
        var sourceElement = doc.querySelector("#dle-content > div.base > div > div.corps > div:nth-child(1) > div:nth-child(4)");

        // Renvoi du contenu extrait
        return {
          targetElement: targetElements[i],
          innerText: sourceElement.innerText.match(/\d+ Episodes/gi)// | Saison \d+
        };
      });
  });

  // Attente de la résolution de toutes les promesses avant de mettre à jour les éléments cibles
  Promise.all(promises).then(function(results) {
    results.forEach(function(result) {
      result.targetElement.innerHTML += "<br>" + result.innerText;
    });
  });
}


if(location.href.search(/((serie|manga)(s)?)&(id|s)/gi)>-1){extractContent();}

})

function csstime(){
GM_addStyle(`
section{padding:0;margin:0}
html,.alt-block,#content,section,.row,.body-inner,ul.dropdown-menu,.scrollable,.right{color:#ddd!important;background:#000!important;}
.credits > p,.social,#get-the-app{display:none;}
#home {color:#ddd;background:#fbd737;}
h3,.label,.expand-icon{color:#fbd737!important;}
.label :hover,[data-toggle] :hover{color:#000!important;background:#fbd737;}
.rank-sticker{color:#000!important;}
span,h2{color:#fff!important;}
#profile,#to-watch,.main-block{color:#ddd;background:#222;}
h1,h2 a{color:#ddd!important;}
.posters-list>li .poster-details .secondary-link{color:#888}
.dropdown{background:#1a1a1a!important;}
#episode-details.episode.episode-header.banner.change-episode-link{
	width: 43%;
border: 0.1vw solid #fbd737!important;}
#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 {
    display: block;color: #7cdb62!important;}
`)}