Ajoute filters, Open All, YouTube trailers, et series recherche pour Oxtorrent/Torrent911.
// ==UserScript==
// @name Oxtorrent/Torrent911
// @namespace https://greasyfork.org/users/PinkyGreasy
// @version 1.0.3
// @description Ajoute filters, Open All, YouTube trailers, et series recherche pour Oxtorrent/Torrent911.
// @author Pinky Greasy
// @license MIT
// @include /^https:\/\/(www\.)?(oxtorrent|torrent9|torrent911|t911)\.[a-z]+\/.*(films|series|detail|torrent|recherche)?.*/
// @grant none
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABYgAAAWIBXyfQUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAgESURBVHic5Zt7rB1VFcZ/6/YJ2NYSsLwjaC9NoVBQBIRawUihiq3SYk1UaCwPBWxTMIIlCGiohlZtYqCgwTdSiS8Qig9MhZIor4g0tLTXCxVKH4p9QF/cy13+sfZk1jmdPTO9njPnACvZOefMfLP3Wt/svfbaa+8jqsobTUTkeGAycCZwNDASWAX8DVigqs+XrkxV274Aw4CPA98DXgQ0p+wGbihbt7RrDxCRMdhbngxMAAZnwFYDj2BGTwEOdvduUtV5hQ21+u26t7xPMPa7QDfZb3c78DvgMuCouuc7gInAOoefUNhui40+CrgcuB/YETFagT8AZwFDS9Q5yT23tK0ICN34Q8BCYGXE2N3Ag8AtQF+4tg34wF60c7ur79CWEgAcBlwE/Bp4JWL0WmBxGMdvc8/OBF533f/DJds8ydV9UaUEAAMwpzUfeCqnW2swbmpBfZ8CegJ+F3BuCR0E2BCe+U3TCQDeAXwWuAvYHDF2E/BjYEYgJ7m+HjimoP6pYWgo8BowvYROPwj4V4EhDSUgeNz3AdcDj7qx6ksf8BhwA3Ay0FFXx7UO+x/gxII2zwF2Bnwv8JkC/DRX/1n/NwFYtDUjvMVNkbe8031fARxYUOdch98MnFKAPyO80WT4XJyDHR56iwKL+kVAGM8zgYcD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hi3ElnOYmM+yfw+SSyVVbsHuLhAv+YRgKWnksp/moO70uGuysH9xOEyd3cx551Eq5uJJDybTgA2jSbJ0leJbERi64MkelwNDI7gTiFNmtyV0+5sZ9CcEj20aQR8zlUcTaBgJzsS3EcjGMGOuCg23WXmArD8YLL9thIY1BICsPk32YB8jsjePRZCJ1mgB3Lau8ApeX0O7laHO7vI+CIC8gKhRI4Qkazg4mRgVPi+CpgjkrVUYDppxLkuUhdYcERQsiOCG4JtyIBlmMeLyPgC/QHGRu+U6AFvtlLTAzLXAm8lKTMEHsbO57yR5Vwsnb6HlCGgT1V3NVafakVEemL33vJDoHICRORYEfmriNwhIodU3X69tKIHXI5NoTOB1SIyT0SGtkAPoDUEeGP3A74OrBSRaS3QpaU+YCu2Ew3wTuBuEVlWMrBpmLSSgC3AicAlWFQHttfwhIjcJiIHVqFES2cBVe1T1duxzM5CLFXWAVwMrBGRuSFD3TRpi2lQVbeq6lXAMdjOMMAIjJQV4Q8STZG2ICARVe1S1SnY8dgkK92JbcE1RdqKABEZKCKzsSVvolsvdqagKVImFK5ERORs4NvUblz8Ecv4PNOsdltOgIh0At/CMsaJdAFzVfXeZrffSgKGiMgCLBGSePptWGC0SFVfq0KJVhJwEOl2VR92vH2eqm6sUolWEKB1v5djB56fbIEuubPAhvA5KgfTH0nG9b+AGao6oQLjvQ0b/I08AhKlOkVkRKM0UdVfYZ5+tKouaVS9BXJS+FyvqqUJeNRh5jdSG1V9tionJyJjsXPGkNpUo0xeZjg5M6jA1yixCdFOBcs7rAn67waOrcfk/nU2ZGxWYOd4wTZAHsH+P9Bf6QbuVNXe0MY44DhgSd21qdihh/7IcGylebqr4yuqumdPLsFiJ+apG5mbn+7qX5dzrRFlG7bkzt6yL9mVOrAU1s9Iu1R/Szfu3yPY8ZY1GdeyjsiXLVuwf5/Op+C88f8AyUJxW5iJZFgAAAAASUVORK5CYII=
// ==/UserScript==
(function () {
'use strict';
function searchTrailerOnYoutube(title) {
// Clean up title for search (remove language tags, quality, year)
let cleanTitle = title
.replace(/\b(FRENCH|TRUEFRENCH|MULTI|VOSTFR|HDTS|CAM|MD|LD|REPACK|HDRip|WEBRIP)\b/gi, '')
.replace(/\b(720p|1080p|2160p|4K)\b/gi, '')
.replace(/\b\d{4}\b/g, '') // remove year
.replace(/\s+/g, ' ')
.trim();
let youtubeUrl = `https://www.youtube.com/results?search_query=${encodeURIComponent(cleanTitle + " trailer")}`;
window.open(youtubeUrl, '_blank');
}
function createOpenAllButton() {
if (document.querySelector('#openAllBtn')) return; // prevent duplicates
// Container for button + checkbox
let container = document.createElement('div');
container.style.display = 'flex';
container.style.alignItems = 'center';
container.style.gap = '10px';
container.style.margin = '10px 0';
container.style.justifyContent = 'center';
// Original button
let btn = document.createElement('button');
btn.id = 'openAllBtn';
btn.innerText = 'Open All';
btn.style.padding = '10px 15px';
btn.style.background = '#007bff';
btn.style.color = '#fff';
btn.style.border = 'none';
btn.style.borderRadius = '5px';
btn.style.cursor = 'pointer';
btn.style.fontSize = '14px';
btn.style.boxShadow = '0 2px 5px rgba(0,0,0,0.3)';
// Create YouTube checkbox
let label = document.createElement('label');
label.style.fontSize = '14px';
label.style.cursor = 'pointer';
let checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = 'youtubeTrailer';
checkbox.style.marginRight = '5px';
checkbox.checked = true;
label.appendChild(checkbox);
label.appendChild(document.createTextNode('YouTube trailer'));
container.appendChild(btn);
container.appendChild(label);
document.querySelector('#dernierstorrents #trier')?.insertAdjacentElement("afterbegin", container);
btn.addEventListener('click', function() {
let links = [...document.querySelectorAll('.listing-torrent > table tr td:first-child a, .listing-torrent .banner-title a[title]')]
.filter(link => link.offsetParent !== null);
let groups = {};
links.forEach(link => {
const text = link.title || link.innerText.trim();
const key = text
.replace(/\b(FRENCH|TRUEFRENCH|MULTI|VOSTFR|HDTS|CAM|MD|LD|REPACK|HDRip|WEBRIP)\b.*$/gi, '')
.replace(/\b(720p|1080p|2160p|4K)\b.*$/gi, '')
// .replace(/\b\d{4}\b/g, '') // remove year
.replace(/\s+/g, ' ')
.trim()
.toLowerCase();
//const quality = link.parentNode.querySelector('.banner-qualite');
if (!groups[key]) groups[key] = [];
groups[key].push({ link: link.href, text });
});
let selectedItems = [];
for (let key in groups) {
let items = groups[key];
items.sort((a, b) => {
let score = (t) => {
if (/720p/i.test(t)) return 3;
if (/1080p/i.test(t)) return 2;
return 1; // fallback
};
return score(b.text) - score(a.text);
});
selectedItems.push(items[0]); // keep the object {link, text}
}
// console.log(`Opening ${selectedItems.length} unique items`);
selectedItems.forEach(item => {
if (checkbox.checked) {
searchTrailerOnYoutube(item.text); // Then open trailer tab
}
window.open(item.link, '_blank'); // Open torrent link
});
});
}
function hideOldMovies() {
let list = document.querySelectorAll('.listing-torrent > table tr td:first-child, .listing-torrent .banner-title a[title]');
let re = new RegExp(' (VOSTFR|HDTS|MD|LD|CAM) ');
const d = new Date();
if (list.length > 0) {
list.forEach((el) => {
const filmName = el.title || el.innerText; //console.log(el);
if (re.test(filmName)) {
el.closest("tr")?.remove();
el.closest("li")?.remove();
} else {
const year = filmName.trim().substr(-4);
if (parseInt(year) <= d.getFullYear() - 3) {
el.closest("tr")?.remove();
el.closest("li")?.remove();
}
}
});
}
}
function openNewBackgroundTab(url) {
var a = document.createElement("a");
a.href = url;
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
true, false, false, false, 0, null);
a.dispatchEvent(evt);
}
function tabifyLinks() {
let links = document.querySelectorAll('.listing-torrent > table tr td:first-child a');
links.forEach((el) => {
el.onclick = function (e) {
e.preventDefault();
openNewBackgroundTab(el.href);
}
});
}
function highlightFrSeries() {
let list = document.querySelectorAll('.listing-torrent > table tr td:first-child');
let re = new RegExp(' VOSTFR ', 'i');
if (list.length > 0) {
list.forEach((el) => {
const filmName = el.innerText;
if (re.test(filmName)) {
el.closest("tr").style.opacity = "0.3";
}
});
}
}
function copyTextToClipboard(element, text) {
var textArea = document.createElement('textarea');
textArea.style.position = 'absolute';
textArea.style.opacity = '0';
textArea.value = text;
document.body.appendChild(textArea);
var execCopy = e => {
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
};
element.addEventListener('mouseup', execCopy, { once: true });
}
function downloadifyPoster() {
let poster = document.querySelector('img.img-rounded');
let download = document.querySelector('[class^="download"] a[href^="magnet"]')?.href || document.querySelector('#torrentsimage a[href*="magnet:"]')?.href;
if (poster) {
poster.style.cursor = "pointer";
if (download) {
let magnet = document.querySelector('[class^="download"] img[alt*="magnet"]') || document.querySelector('#torrentsimage a[href*="magnet:"]');
if (magnet) {
poster.onmousedown = e => magnet.closest('a').click();
}
} else {
poster.onmousedown = e => copyTextToClipboard(poster, download);
}
}
}
function youtubifyTitle() {
let name = '';
let searchUrl = '';
let titles = document.querySelectorAll('.title > a[title], .block-detail .title:has(i.fa-bars)');
if (titles.length > 0) {
titles.forEach(titleEl => {
name = (titleEl.title || titleEl.innerText).replace(/(MULTI|REPACK|FRENCH|TRUEFRENCH|HDRip).+/, '').trim();
searchUrl = "https://www.youtube.com/results?search_query=" + encodeURIComponent(name) + " trailer";
if(!titleEl.href){
titleEl.innerHTML = `<a href="${searchUrl}" target="_blank">${titleEl.innerHTML}</a>`;
}
titleEl.href = searchUrl;
titleEl.target = '_blank';
});
}
else {
name = Array.from(document.querySelectorAll('#torrentsimage tr td:first-child')).find(td => td.textContent.includes("Titre:"))?.nextElementSibling?.innerText.replace(/(MULTI|REPACK|FRENCH|TRUEFRENCH|HDRip).+/, '').trim() || '';
searchUrl = name ? "https://www.youtube.com/results?search_query=" + encodeURIComponent(name) + " trailer" : searchUrl;
}
// add Trailer button
if(!searchUrl) return;
const dataURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAABqCAMAAABQzb7AAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAF1QTFRFAAAA8wYK8QcL8gcM7AQI7QgK8gcM8wcN7xAV9AkQ8gcN8QYN7wQ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YCBH9YBxvC1xY1NRQiWBLPs09krwYu+CEwVwZcCrH48wIA1+RyH/LjGfPqGLWBeyyRmoaQrjKHZn26DPXBGAYtCh4BRuzXU5LgXjHyqfBqYvThmtGmHFLmZ0uu2P55iiz9Sl83q4RQwRWJATAkKhfg5sHVfjVM+D8zaXR/4U0y8mM7u2gV9WxGmM19aVyTA8OCXQlkFL8dRm7q0ZcwvLt/wV80MJJMhfo0TolIByyhdG1K+BPjoK2DKgFXF9TITLJ2S+VXA9BjzRhTIbsmm33XWcUwBjEQ4Vn3Nm97YGxfALIU9LRmvxbVA/DbAXB/kWEbLe+AXv1BMSzdVjOkCA1Gh6bggLCUdvqqwa+X2sn9Nt3SAkd/aNLQwA6lhN/smzDN6BsWema6RCFcxZsvjrsPxY+KZyg+j0q9Nfp0VHDbMlfR8oDMX6H0I9HNGlSl1ANgznR8H5iulbTV8yO/5Gj+is46m5CDSs9XPIRUp2QIgBQxPjrSYUKkOD3bxlxQkDA0SQxkkDMWDnWlQqIGhTwSM4xxbKkeQqMpvAkzxm+HGjWnhJWS6lCsYtvipRJlE5nSTSiq4SnwPl98DmPBWSqxLvzMv07i1mWN1JLMAmUVL+vqfCsyVf2VJBpn+zwQb2amGMfmDBPt0tA9MH4I6j/QriuCixu8Hnwff+GqlMY3EmFp8U/l8lPIbMCbkzYU6gvufZ+csHObF5Mwc+ST0WDQy/0RgPtSreoX1eO9lE0KZfOiYUg1ML8BbPkOgXw1MKH6XoeSGc97ZGhbDa022SEtkj67F9xhjfp+JNJfb+Xu5ktj4n/T/cPO9C7J/lndyyl+H5Rn0P67c9v8fbnjKbu5S+L9WDv5f//5bqPwH3BPyPTA9GasAAAAASUVORK5CYII=';
// Create <a> link wrapper
const link = document.createElement('a');
link.href = searchUrl;
link.target = "_blank";
link.style.textDecoration = "none";
link.style.display = "inline-block";
// Create container <div>
const div = document.createElement('div');
div.style.display = "inline-block";
div.style.borderRadius = "12px";
div.style.overflow = "hidden";
div.style.transition = "transform 0.2s ease, box-shadow 0.2s ease";
// Add hover effects dynamically
div.addEventListener("mouseenter", () => {
div.style.transform = "scale(1.05)";
div.style.boxShadow = "0 4px 12px rgba(0,0,0,0.3)";
});
div.addEventListener("mouseleave", () => {
div.style.transform = "";
div.style.boxShadow = "";
});
// Create the <button>
const button = document.createElement('button');
button.style.width = "130px";
button.style.height = "50px";
button.style.border = "none";
button.style.cursor = "pointer";
button.style.borderRadius = "12px";
button.style.backgroundImage = `url(${dataURI})`;
button.style.backgroundPosition = "center";
button.style.backgroundRepeat = "no-repeat";
button.style.backgroundSize = "contain";
button.style.backgroundColor = "transparent";
button.style.display = "block";
// Append everything
div.appendChild(button);
link.appendChild(div);
document.querySelector('#torrentsimage td:nth-child(2)').insertAdjacentElement("afterbegin", link);
div.closest('td').style.display = "inline-flex";
div.closest('td').style.width = "auto";
}
function cleanSerieName(rawName) {
// Replace dots with spaces
let name = rawName.replace(/\./g, ' ');
// Capture everything up to SxxExx
let match = name.match(/^(.*?\bS\d{2}E)\d{2}/i) || name.match(/^(.*?)\s+\b(FRENCH|TRUEFRENCH|MULTI|VOSTFR|HDTS|CAM|MD|LD|REPACK|HDRip|WEBRIP)\b/i);
if (match) {
return match[1].trim();
}
// If no SxxExx found, return cleaned name without extension
return name.replace(/\.[^.]+$/, '').trim();
}
function searchifySerie() {
const elements = document.querySelectorAll('#torrentsimage .maximums');
elements.forEach(el => {
el.style.cursor = "pointer";
el.addEventListener('click', (e) => {
e.preventDefault();
let rawName = el.textContent.trim();
let cleanedName = cleanSerieName(rawName);
let searchUrl = `/recherche/${encodeURIComponent(cleanedName)}`;
window.open(searchUrl, '_blank'); // open in new tab
});
});
}
function cleanSearchInput(){
const searchInput = document.querySelector('form input[placeholder="Recherche..."]');
searchInput.addEventListener('input', function(e) {
// Replace all dots with spaces
this.value = this.value.replace(/\./g, ' ');
});
searchInput.addEventListener('paste', function(e) {
// Prevent default paste behavior
e.preventDefault();
// Get pasted text and replace dots with spaces
const pastedText = (e.clipboardData || window.clipboardData).getData('text');
const cleanedText = pastedText.replace(/\./g, ' ');
// Insert cleaned text at cursor position
const start = this.selectionStart;
const end = this.selectionEnd;
const currentValue = this.value;
this.value = currentValue.substring(0, start) + cleanedText + currentValue.substring(end);
// Set cursor position after inserted text
const newPosition = start + cleanedText.length;
this.setSelectionRange(newPosition, newPosition);
});
}
setTimeout(() => {
const page = location.href;
console.log("Tampermonkey Script Loaded!", page);
if (page.match(/(torrent|detail)\/[0-9]+/)) { console.log("page");
downloadifyPoster();
youtubifyTitle();
searchifySerie();
} else if (page.includes("series")) { console.log("series");
highlightFrSeries();
tabifyLinks();
} else if (page.includes("films")) { console.log("films");
hideOldMovies();
tabifyLinks();
createOpenAllButton();
}
cleanSearchInput();
}, 1000);
})();