推荐语众包音乐内嵌播放

try to take over the world!

  1. // ==UserScript==
  2. // @name 推荐语众包音乐内嵌播放
  3. // @version 0.1
  4. // @description try to take over the world!
  5. // @author You
  6. // @match https://st.music.163.com/music-webview-content/tag.html
  7. // @grant none
  8. // @run-at document-start
  9. // @namespace https://gf.qytechs.cn/users/141
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const audio = document.createElement('audio');
  16. audio.setAttribute('autoplay', 'autoplay');
  17. audio.setAttribute('controls', 'controls');
  18. audio.setAttribute('style', 'left: 0; top: 20px; width: 100%; position: fixed');
  19.  
  20. class FakeXMLHttpRequest extends XMLHttpRequest {
  21. open(...args) {
  22. if (args[1].indexOf('api/song/comment/zhongbao/comment/get') >= 0) {
  23. this.addEventListener('load', () => {
  24. audio.src = 'http://music.163.com/song/media/outer/url?id=' + JSON.parse(this.responseText).data.songId + '.mp3';
  25. document.body.appendChild(audio);
  26. audio.play();
  27. });
  28. }
  29. super.open(...args);
  30. }
  31. }
  32. window.XMLHttpRequest = FakeXMLHttpRequest;
  33. })();

QingJ © 2025

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