DPStream.net Unbriding

This script will help unbriding movies/series

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
  
});