DPStream.net Unbriding

This script will help unbriding movies/series

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         DPStream.net Unbriding
// @namespace    DPStream.net Unbriding
// @version      0.3
// @description  This script will help unbriding movies/series
// @author       Kursion
// @grant        none
// @match 		 http://www.dpstream.net/serie-*
// @match 		 http://mondebrideur.com/pureapi.php?id=*
// @require		 http://code.jquery.com/jquery-latest.js
// ==/UserScript==

$(document).ready(function() {
  console.log("DPStream.net Unbriding started");
  var interval = undefined;
  var getLinks = function(){
    console.log("Executing getLinks()")
    // The div containing links
    var container = $("<div/>");
    
    var countLinks = 0;
    $("a").each(function(i){
      var link = $(this).attr("href");
      if(link.indexOf("purevid.com/v/") > 0){
        link = link.replace("http://www.purevid.com/v/", "").slice(0,-1)
        var ahref = $("<a/>", {
          href: "http://mondebrideur.com/pureapi.php?id="+link+"&java=0",
          text: link,
          target: "_blank",
        });
        var div = $("<div/>").html(ahref);
        container.append(div);
        countLinks++;
      }
    });
    if(countLinks > 0){
      container.css({
        position: "absolute",
        width: "350px",
        backgroundColor: "#333333",
        color: "#efefef",
        margin: "auto",
        left: 0,
        right: 0,
        top: "10px",
        padding: "10px",
        borderRadius: "10px"
      });
      $("body").append(container);
      $("body").scrollTop(0);
      clearInterval(interval);
    }
  };
  
  interval = setInterval(getLinks, 2000);
  
});