qtfm-download

蜻蜓FM-节目下载

  1. // ==UserScript==
  2. // @name qtfm-download
  3. // @namespace https://gf.qytechs.cn/zh-CN/users/135090
  4. // @version 0.6
  5. // @author zwb83925462
  6. // @match https://www.qtfm.cn/channels/*/programs/*/
  7. // @match https://www.qingting.fm/channels/*/programs/*/
  8. // @icon https://www.qingting.fm/favicon.ico
  9. // @grant none
  10. // @run-at document-end
  11. // @description 蜻蜓FM-节目下载
  12. // @license CC
  13. // ==/UserScript==
  14. (function() {
  15. 'use strict';
  16. setTimeout(function(){
  17. var qtapi=null;
  18. if (location.hostname.includes("qingting.fm")) {
  19. qtapi="https://webapi.qingting.fm/api/mobile/"+location.href.substring(24);
  20. } else if (location.hostname.includes("qtfm.cn")) {
  21. qtapi="https://webapi.qtfm.cn/api/mobile/"+location.href.substring(20);
  22. }
  23. fetch(qtapi).then(res=>{return res.text()}).then(txt=>{return JSON.parse(txt)?.programInfo})
  24. .then(pinfo=>{
  25. console.log(pinfo);
  26. var au=pinfo?.audioUrl;
  27. var ahref=null;
  28. if (pinfo?.saleStatus == "free" ){
  29. ahref=au;
  30. var avd=document.createElement('video');
  31. avd.style.width="800px";
  32. avd.style.height="auto";
  33. avd.style.position="fixed";
  34. avd.style.top="450px";
  35. avd.style.left="2px";
  36. avd.src=ahref;
  37. avd.setAttribute('controls','');
  38. avd.controlslist="noremoteplayback";
  39. document.body.append(avd);
  40. } else {
  41. ahref=au.length > 0 ? au : "#";
  42. }
  43. var aqt=document.createElement("a");
  44. aqt.style.position="fixed";
  45. aqt.style.top="250px";
  46. aqt.style.left="2px";
  47. aqt.href=ahref;
  48. aqt.download=pinfo?.title+".m4a";
  49. aqt.value=pinfo?.title;
  50. aqt.textContent=pinfo?.saleStatus == "free" ? pinfo?.title : "收费音频,无法下载";
  51. document.body.append(aqt);
  52. /*
  53. {
  54. var atk="&access_token="+JSON.parse(localStorage.accessToken)?.value;
  55. atk += "&"+document.cookie.substring(document.cookie.indexOf('qingting'),document.cookie.indexOf('Hm_lpvt')-2);
  56. ahref=au+atk;
  57. }
  58. */
  59. console.log(ahref);
  60. });
  61. });
  62. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址