Greasy Fork

Greasy Fork is available in English.

网易云音乐 - 显示歌单中的所有歌曲

显示歌单中的所有歌曲

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name                CloudMusic - Show all songs on the playlist
// @name:zh-CN          网易云音乐 - 显示歌单中的所有歌曲
// @namespace           http://greasyfork.icu/zh-CN/users/193133-pana
// @homepage            https://www.sailboatweb.com
// @version             2.0.1
// @description         Show all songs in the playlist
// @description:zh-CN   显示歌单中的所有歌曲
// @author              pana
// @license             GNU General Public License v3.0 or later
// @match               *://music.163.com/*
// @grant               none
// ==/UserScript==

(function() {
    'use strict';
    var cookie = {
        set: function(key, val, time) {
            let date = new Date();
            let expires_days = time;
            date.setTime(date.getTime() + expires_days * 24 * 3600 * 1000);
            document.cookie = key + "=" + val + ";expires=" + date.toGMTString();
        },
        get: function(key) {
            let get_cookie = document.cookie.replace(/[ ]/g, "");
            let arr_cookie = get_cookie.split(";");
            let tips;
            for (let i = 0; i < arr_cookie.length; i++) {
                let arr = arr_cookie[i].split("=");
                if (key === arr[0]) {
                    tips = arr[1];
                    break;
                }
            }
            return tips;
        },
        delete: function(key) {
            let date = new Date();
            date.setTime(date.getDate() - 1);
            document.cookie = key + "=v; expires =" + date.toGMTString();
        }
    };
    function init_Cloud_Music() {
        if (cookie.get('os') != 'pc' || cookie.get('appver') != '2.7.1.198242') {
            cookie.set('os', 'pc', 30);
            cookie.set('appver', '2.7.1.198242', 30);
            location.reload();
        }
        if (location.href.indexOf('/playlist?id=') !== -1) {
            if (document.getElementById('m-playlist')) {
                document.querySelectorAll('.soil').forEach((item) => {
                    item.parentNode.removeChild(item);
                });
            }
        }
    }
    init_Cloud_Music();
})();