qtfm-download

蜻蜓FM下载

当前为 2022-01-13 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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();
    }
})();