qtfm-download

蜻蜓FM下载

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

  1. // ==UserScript==
  2. // @name qtfm-download
  3. // @namespace https://greasyfork.org/zh-CN/users/135090
  4. // @version 0.2
  5. // @author zwb83925462
  6. // @match https://www.qingting.fm/channels/*/
  7. // @exclude https://www.qingting.fm/channels/*/programs/*/
  8. // @match https://webapi.qtfm.cn/api/mobile/*
  9. // @icon https://www.qingting.fm/favicon.ico
  10. // @grant none
  11. // @run-at document-end
  12. // @description 蜻蜓FM下载
  13. // @license CC
  14. // ==/UserScript==
  15. (function() {
  16. 'use strict';
  17. if (location.hostname == "www.qingting.fm"){
  18. setTimeout(function(){
  19. document.querySelectorAll(".pTitle").forEach(function(item,index){
  20. var ea=document.createElement("a");
  21. ea.style.fontSize="2rem";
  22. ea.textContent="下"+unescape("\u3000")+"载"
  23. ea.id="qt"+index;
  24. ea.target="_blank";
  25. ea.href="https://webapi.qtfm.cn/api/mobile/"+item.href.substring(24);
  26. item.parentElement.parentElement.querySelector(".col2>.action").innerHTML=null;
  27. item.parentElement.parentElement.querySelector(".col2>.action").append(ea);
  28. });
  29. },1500);
  30. }else if (location.hostname == "webapi.qtfm.cn"){
  31. var pInfo=JSON.parse(document.body.textContent).programInfo;
  32. var url=pInfo.audioUrl;
  33. document.writeln("<center><h2>"+pInfo.title+"</h2></center>");
  34. document.writeln("<hr /><center>");
  35. document.writeln("<video width=80% height=auto controls src="+url+"></video>");
  36. document.writeln("</center><hr />");
  37. document.title=pInfo.title;
  38. document.close();
  39. }
  40. })();