9酷

9酷歌曲广告剔除

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         9酷
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  9酷歌曲广告剔除
// @author       gwbc
// @match        https://www.9ku.com/*
// @icon         https://scpic.chinaz.net/Files/pic/icons128/8169/e12.png
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    try{
        let youFix = document.querySelector('div.youFix');
        if(youFix != null)
        {
            youFix.remove();
        }

        let iframes = document.querySelectorAll('iframe');
        for (let i = 0; i < iframes.length; ++i) {
            iframes[i].remove();
        }

        let box = document.querySelector('.box');
        if(box != null)
        {
            let boxWidth = document.querySelector('.box').getBoundingClientRect().width;
            let boxHeight = document.querySelector('.nplayL-box').getBoundingClientRect().height
            document.querySelector('.pFl.clearfix').style.width = boxWidth + "px";
            document.querySelector('.nplayL-box').style.width = boxWidth / 2 + "px";
            document.querySelector('.ppR').style.width = boxWidth / 2 + "px";
            document.querySelector('.playingTit').style.width = boxWidth / 2 - 22 + "px";
            document.querySelector('.oldPlayer').style.margin = 0;
            document.querySelector('.lrcBox').style.width = boxWidth / 2 - 2 + "px";
            document.querySelector('.lrcBox').style.height = boxHeight - 111 + "px";
            document.querySelector('.oldPlayer').style.width = boxWidth / 2 - 22 + "px";
            document.querySelector('.ncol-btns').remove();
            document.querySelector('.dongBox.mb10').remove();
            document.querySelector('#p_top').remove();
            document.querySelector('.fotter').remove();
            document.querySelector('.ppBox').style.height = boxHeight - 2 + "px";
            document.querySelector('.ppBox').style.borderBottom = "1px solid #259b24";
            document.querySelector('.jp-progress').style.width = boxWidth / 2 - 20 + "px";
            document.querySelector('#lyric').style.height = boxHeight - 100 + "px";
        }

    }catch(e){
        //TODO handle the exception
    }

    var count = 0
    var t = setInterval(function() {
        count++;
        if (count > 2000) {
            clearInterval(t);
        }

        try {
            let iframes = document.querySelectorAll('iframe');
            for (let i = 0; i < iframes.length; ++i) {
                iframes[i].remove();
            }

            let sprris = document.querySelectorAll('#songlist li');
            for (let i = 0; i < sprris.length; ++i) {
                if (sprris[i].id.length != 0) {
                    sprris[i].remove();
                }
            }

            if(sprris.length != 0)
            {
                document.querySelector('.box.bgWrite.mb10.clearfix').remove();
                document.querySelector('.xxl.clearfix').remove();
                document.querySelector('.box.bgWrite.mb10').remove();
                document.querySelector('#fankui').remove();
                document.querySelector('#weixin').remove();
                document.querySelector('#gotop').remove();
            }

            let ls = document.querySelectorAll('.musicList li[style*="position:relative"]');
            for (let i = 0; i < ls.length; ++i)
            {
                ls[i].remove();
            }

        } catch (e) {

        }
    }, 1);
})();