Swyter Tweaks for Played.to

Gets rid of all the hurdles and directly plays the video in an immersive player.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          Swyter Tweaks for Played.to
// @description   Gets rid of all the hurdles and directly plays the video in an immersive player.
// @match         http://played.to/*
// @grant         none
// @version       2013.11.28
// @author        Swyter
// @namespace https://greasyfork.org/users/4813
// ==/UserScript==

if ( btn_download = document.querySelector("#btn_download") )
{
    // Click the accept button if exists
    console.log("-> Skipping the countdown.")
    
    btn_download.disabled=false;
    btn_download.click();
}
else
{
    // Remove all the timeouts, which launch banners and all sorts of ugly monsters (http://stackoverflow.com/a/8345837/674685)
    var highestTimeoutId = setTimeout(";");
    for (var i = 0 ; i < highestTimeoutId ; i++) {
        clearTimeout(i); 
    }


    // Just remove the annoyances, enable the built-in lightbox and enjoy the view
    var ads = document.querySelectorAll(
        "div[style*='block !important;'], #overlayPPU, #OnPlayerBanner, #OnPlayerClose, center>div+script[type='text/javascript']"
    );
    
    Array.prototype.forEach.call(ads,function(node) {
        node.parentNode.removeChild(node);
    });
    
    document.getElementById("lightsOff").click();
}