蜻蜓FM下载
当前为
// ==UserScript==
// @name qtfm-download
// @namespace https://greasyfork.org/zh-CN/users/135090
// @version 0.1
// @author zwb83925462
// @match https://www.qingting.fm/channels/*/
// @exclude https://www.qingting.fm/channels/*/programs/*/
// @match https://webapi.qtfm.cn/api/mobile/*
// @icon https://www.qingting.fm/favicon.ico
// @grant none
// @run-at document-end
// @description 蜻蜓FM下载
// @license CC
// ==/UserScript==
(function() {
'use strict';
if (location.hostname == "www.qingting.fm"){
setTimeout(function(){
document.querySelectorAll(".pTitle").forEach(function(item,index){
var ea=document.createElement("a");
ea.style.fontSize="2rem";
ea.textContent="下"+unescape("\u3000")+"载"
ea.id="qt"+index;
ea.target="_blank";
ea.href="https://webapi.qtfm.cn/api/mobile/"+item.href.substring(24);
item.parentElement.parentElement.querySelector(".col2>.action").innerHTML=null;
item.parentElement.parentElement.querySelector(".col2>.action").append(ea);
});
},1500);
}else if (location.hostname == "webapi.qtfm.cn"){
var pInfo=JSON.parse(document.body.textContent).programInfo;
var url=pInfo.audioUrl;
document.writeln("<center><h2>"+pInfo.title+"</h2></center>");
document.writeln("<hr /><center>");
document.writeln("<video width=auto height=auto controls src="+url+"></video>");
document.writeln("</center><hr />");
document.title=pInfo.title;
document.close();
}
})();