Disable Ads And CountDowns On Brazilian Websites To Download Torrent Movies

Desativa contadores JS e propagandas em sites brasileiros para baixar filmes em sites de torrent que te redirecionam para o site mastercuriosidadesbr.com ou para outros sites

目前为 2020-08-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         Disable Ads And CountDowns On Brazilian Websites To Download Torrent Movies
// @namespace    hacker09
// @version      0.6
// @description  Desativa contadores JS e propagandas em sites brasileiros para baixar filmes em sites de torrent que te redirecionam para o site mastercuriosidadesbr.com  ou para outros sites
// @author       hacker09
// @match        https://filmesx.biz/*
// @match        https://ondebaixo.com/*
// @match        https://ondebaixa.com/*
// @match        https://ondeeubaixo.org/*
// @match        https://www.adrenalinagames.com/*
// @match        https://www.mastercuriosidadesbr.com/*
// @match        https://www.thepiratefilmestorrent.tv/*
// Abaixo segue a lista dos piores websites para se baixar e ver filmes,eles serão automaticamente redirecionados para o google. São todos sites cheios de propagandas, e que teoricamente deveriam permitir assistir e/ou baixar filmes, porem não e possível fazer isso nesse sites falsos.
// @match        https://topflix.vip/*
// @match        https://todosfilmeshd.net/*
// @match        http://aquitemfilmes.info/*
// @match        https://www.filmesdetv.com/*
// @match        https://filmestvdublado.home.blog/*
// @grant        none
// @run-at document-idle
// ==/UserScript==

(function() {
    'use strict';
var $ = window.jQuery; //Defines That The Symbol $ Is A jQuery

// The codes below redirects trash websites to google
if ((top.location.host === 'todosfilmeshd.net') || (top.location.host === 'filmestvdublado.home.blog') || (top.location.host === 'topflix.vip') || (top.location.host === 'aquitemfilmes.info') || (top.location.host === 'www.filmesdetv.com')) //Make sure to run on the correct websites only
{
    window.location.assign("https://google.com")
} // Finishes the if condition

if (top.location.host === 'filmesx.biz') //Make sure to run on the correct website only
{setTimeout(function(){ $("img.lazyloaded")[2].remove(); }, 1500);} //Removes the fake download button

if (top.location.host === 'www.mastercuriosidadesbr.com') //Make sure to run on the correct website only
{
    document.querySelector("#aviso").style.display = "none"; //Disable Counter Text
    document.querySelector("#loko").style.display = "none"; //Disable Fake Download Button
    document.querySelector("#baixar").style.display = ""; //Enable Real Download Button
    document.oncontextmenu = function() {} //Enables Right Mouse Click
} // Finishes the if condition

if (top.location.host === 'www.adrenalinagames.com') //Make sure to run on the correct website only
{
    document.getElementById('link0').style.display="none"; //Hides the fake download button
    document.getElementById('link').style.display="block"; //Show the real download button
    document.getElementById('msg').style.display="none"; //Disable the message "Clique uma vez em um dos anuncios,aguarde 20 segundos na pagina que ira abrir, apos isso o seu download sera liberado"
} // Finishes the if condition


if ((top.location.host === 'ondebaixa.com') || (top.location.host === 'ondeeubaixo.org') || (top.location.host === 'ondebaixo.com')) //Make sure to run on the correct website only
{
    // Todos os codigos abaixo extraem o conteudo html de todos os botoes e depois os injetam novamente nos botoes, isso e um hack que burla o sistema do site de redirecionar os usuarios a sites com propagandas e temporadizadores JS

    if (document.querySelector('a.text-center.newdawn.btn.btn-success') !== null) //Make sure to run only if the button exits
    {
        var all = $('a.text-center.newdawn.btn.btn-success'); //Select and store the total buttons number
        for (var i=0, max=all.length; i < max; i++) //For every single button Do...
        {
         var VERSÃODUALÁUDIObtnouterHTML = $('a.text-center.newdawn.btn.btn-success')[i].outerHTML; //Create a variable to store the html of the button
         $('a.text-center.newdawn.btn.btn-success')[i].outerHTML = VERSÃODUALÁUDIObtnouterHTML; //Re-Inject the html of the button in the button again
      } // Finishes the for condition
} // Finishes the if condition to check if the button exists or not

    if (document.querySelector('a.text-center.newdawn.btn.btn-danger') !== null) //Make sure to run only if the button exits
    {
        var all = $('a.text-center.newdawn.btn.btn-danger'); //Select and store the total buttons number
        for (var i=0, max=all.length; i < max; i++) //For every single button Do...
     {
         var VERSÃOLEGENDADAbtnouterHTML = $('a.text-center.newdawn.btn.btn-danger')[i].outerHTML; //Create a variable to store the html of the button
         $('a.text-center.newdawn.btn.btn-danger')[i].outerHTML = VERSÃOLEGENDADAbtnouterHTML; //Re-Inject the html of the button in the button again
      } // Finishes the for condition
} // Finishes the if condition to check if the button exists or not

    if (document.querySelector('a.text-center.newdawn.btn.btn-info') !== null) //Make sure to run only if the button exits
    {
        var all = $('a.text-center.newdawn.btn.btn-info'); //Select and store the total buttons number
        for (var i=0, max=all.length; i < max; i++) //For every single button Do...
        {
         var VERSÃOLEGENDADAbtnouterHTML = $('a.text-center.newdawn.btn.btn-info')[i].outerHTML; //Create a variable to store the html of the button
         $('a.text-center.newdawn.btn.btn-info')[i].outerHTML = VERSÃOLEGENDADAbtnouterHTML; //Re-Inject the html of the button in the button again
      } // Finishes the for condition
} // Finishes the if condition to check if the button exists or not

    if (document.querySelector('a.text-center.newdawn.btn.btn-primary') !== null) //Make sure to run only if the button exits
    {
        var LEGENDASprimarybtnouterHTML = document.querySelector('a.text-center.newdawn.btn.btn-primary').outerHTML;
        document.querySelector('a.text-center.newdawn.btn.btn-primary').outerHTML = LEGENDASprimarybtnouterHTML;
    } // Finishes the if condition to check if the button exists or not
} // Finishes the if condition for the website ondebaixa.com

if (top.location.host === 'www.thepiratefilmestorrent.tv') //Make sure to run on the correct website only
{
//O script abaixo suporta "Parcialmente" o site https://www.thepiratefilmestorrent.tv
//Atualmente o script funciona apenas para o primeiro botao de download,se houver mais que um botao de download o script nao vai funcionar nos outros botoes de download. Talvez eu arrume isso no futuro,eu poderia adicionar um counter que rodaria essa funcao para cada botao de download existente na pagina, e que tambem usaria o counter para definir em JQuery qual o "numero" do botao que teria o link desprotegido,isso faria com que o script funcionasse para todos os botoes de download existentes na pagina.
//Para possiveis referencias e testes futuros aqui estao 2 links com + que 1 botao de download https://www.thepiratefilmestorrent.tv/perry-mason-1a-temporada-torrent-2020-dual-audio-web-dl-720p-download/
// https://www.thepiratefilmestorrent.tv/acuaman-torrent-2019-dublado-dual-audio-web-dl-720p-e-1080p-download/
document.addEventListener('DOMContentLoaded', function() // Wait for the website to fully load
    {
     setTimeout(function() {
var protectedlink = document.querySelector('img.alignnone.wp-image-7.size-medium').parentElement.href; //Get the protected Link
var api = 'https://retrolink.com.br/api/?url=' + protectedlink; //Adds the protected link to the api that will be called and used latter

const Http = new XMLHttpRequest(); //Start the api call
const url = api; //Set the api url to be called
Http.open("GET", url); //Set the get method to call the api url
Http.send(); //Send the api request

Http.onreadystatechange = function() //When the request response is received
{
    if (Http.readyState == 4 && Http.status == 200) //Check if the response was fully received and ended or not
    {
        var unprotectedlink = Http.responseText.match(/['"](magnet.*?)['"]/g)[0].replace(/"/,''); //Get only the unprotected link out of the api response
        document.querySelector('img.alignnone.wp-image-7.size-medium').parentElement.href =unprotectedlink; //Replace the current protected download link with the unprotected download link
        document.querySelector('img.alignnone.wp-image-7.size-medium').parentElement.setAttribute("target", ""); //Removes the target attribute on the download button, so that the url will open in the sabe tab,not on a new tab
        var donebtn = document.createElement("a"); //Creates an a html element
        donebtn.innerHTML = "Pronto Para Baixar"; //Adds the text "Pront Para Baixar"
        document.querySelector('img.alignnone.wp-image-7.size-medium').parentElement.appendChild(donebtn); //Specifies that the text "Pront Para Baixar" should be added close to the download button
        donebtn.setAttribute("id", "donebtn"); //Set the id "donebtn" to the html text "Pronto Para Baixar"
        donebtn.setAttribute("style", "padding-left: 350px;"); //Set the css for the html text "Pronto Para Baixar"
    } //Finishes the if condition
} //Finishes the onreadystate condition
}, 1); //Finishes the timeout function and run the function after 1 millisecond
}, false); //Finishes the condition that will wait the website to fully load
} //Finishes the if condition
})();