[timerd] 音乐解析 网易、QQ、酷狗、酷我(新增)、(定期更新增加新的解析网站)(2019-09-20)更新

音乐解析 网易、QQ音乐解析 欢迎收听!

As of 20/09/2019. See the latest version.

  1. // ==UserScript==
  2. // @name [timerd] 音乐解析 网易、QQ、酷狗、酷我(新增)、(定期更新增加新的解析网站)(2019-09-20)更新
  3. // @namespace http://timerd.ml
  4. // @version 0.0.11
  5. // @description 音乐解析 网易、QQ音乐解析 欢迎收听!
  6. // @author timerd
  7. // @include *://music.163.com/*song*
  8. // @include *://y.qq.com/*/song/*
  9. // @include *://*.kugou.com/song/*
  10. // @include *://*.kuwo.cn/*
  11. // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
  12. // @icon http://timerd.me/favicon.ico
  13. // @run-at document-end
  14. // @grant unsafeWindow
  15. // @license MIT2.0
  16. // ==/UserScript==
  17.  
  18.  
  19. (function () {
  20.  
  21. 'use strict';
  22. function addInfrastructure() {
  23. let style = document.createElement("style");
  24. style.appendChild(document.createTextNode(`
  25. #mywidget a {
  26. position: absolute;
  27. left: -75px;
  28. transition: 0.3s;
  29. padding: 15px 30px 15px 15px;
  30. text-decoration: none;
  31. color: white!important;
  32. border-radius: 0 8px 8px 0;
  33. font: 20px "Microsoft YaHei",SimHei,helvetica,arial,verdana,tahoma,sans-serif;
  34. min-width: 80px;
  35. text-align:right;
  36. white-space:nowrap;
  37. }
  38.  
  39.  
  40. #mywidget a:hover {
  41. left: 0;
  42. }
  43. #vparse {
  44. background-color: #f44336;
  45. }
  46.  
  47. #myplaybutton {
  48. position:absolute;
  49. right:-8px;
  50. top: 14px;
  51. width:0px;
  52. height:0px;
  53. margin:0px;
  54. border-width: 16px;
  55. border-style: solid;
  56. border-color:transparent transparent transparent white;
  57. }
  58.  
  59. #mywidget a img {
  60. width: 28px;
  61. height:34px;
  62. position: absolute;
  63. top:12px;
  64. right: 5px;
  65. align-items: center;
  66. }`));
  67.  
  68. document.head.appendChild(style);
  69. }
  70.  
  71.  
  72. let playurl = window.location.href;
  73. let rArray = playurl.split('?');
  74. let cWeb = rArray[0];
  75.  
  76. const musicSites = new Array();
  77. musicSites[0]=/163(.*)song/i;
  78. musicSites[1]=/QQ(.*)song/i;
  79. musicSites[2]=/(.*)kugou.com/i;
  80. musicSites[3]=/(.*)kuwo.cn/i;
  81. musicSites.every((item) => {
  82. if (item.test(cWeb)) {
  83. addInfrastructure();
  84. var jumpButton = $(`
  85. <div id="mywidget" href='javascript:void(0)' target='_blank' style="z-index:9999; position:fixed;left:0px;top:280px;">
  86. <a href="#" id="vparse">❀音乐解析<div id="myplaybutton"></div></a>
  87. </div>
  88. `);
  89. $("body").append(jumpButton);
  90. // bind onclick event
  91. $("#mywidget").click(function () {
  92. var openUrl = window.location.href;
  93. window.open('https://chinese-elements.com/m.html?zxm=' + encodeURIComponent(openUrl));
  94. });
  95. return false;
  96. }
  97. return true;
  98. });
  99. })()