Greasy Fork

Greasy Fork is available in English.

国家大剧院古典音乐频道下载

try to open the classical music's door!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         国家大剧院古典音乐频道下载
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  try to open the classical music's door!
// @author       williamslay
// @match        http://ncpa-classic.cntv.cn/*
// @match        http://www.ncpa-classic.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        GM_addStyle
// @run-at document-end
// ==/UserScript==
window.onload=function(){
    'use strict';
    let download=document.createElement("a");
    download.setAttribute("class", "download");
    download.setAttribute("download", true);
    //var audioplayer=document.getElementById("audioplayer");
    //var url=audioplayer.src;
     //download.href=url;
    let myText = document.createTextNode("下载");
     GM_addStyle ( `
        .download {
           width: 38px;
           height: 18px;
           line-height: 18px;
           text-align: center;
           background-color: #577891;
           font-size: 14px;
           font-family: "宋体";
           cursor: pointer;
           display:inline-block;
           position:absolute;
           left: 63%;
          top: 35%;
           };
    ` );
    download.onclick=function downloadUrlFile() {
    let tempForm = document.createElement('form')
    var audioplayer=document.getElementById("audioplayer");
    var url=audioplayer.src;
    tempForm.action = url
    tempForm.method = 'get'
    tempForm.style.display = 'none'
    document.body.appendChild(tempForm)
    tempForm.submit()
    return tempForm
}
    download.appendChild(myText);
    var parent=document.getElementsByClassName("nr_2");
    var node=document.getElementById("audio_title_div");
    parent[0].insertBefore(download,node);
console.log("开发者williamslay,github:https://github.com/williamslay")
}