NeteaseMusic Resolution Upgrader

Force playing high quality music in Netease cloud music Website

  1. // ==UserScript==
  2. // @name NeteaseMusic Resolution Upgrader
  3. // @namespace https://github.com/nondanee
  4. // @version 0.2.1
  5. // @description Force playing high quality music in Netease cloud music Website
  6. // @author nondanee
  7. // @match https://music.163.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (() => {
  12. let _asrsea
  13. const asrsea_ = (...payload) => {
  14. const data = JSON.parse(payload[0])
  15. if ('level' in data) data.level = 'exhigh'
  16. payload[0] = JSON.stringify(data)
  17. return _asrsea.apply(window, payload)
  18. }
  19. if (window.asrsea) {
  20. _asrsea = window.asrsea
  21. window.asrsea = asrsea_
  22. }
  23. else {
  24. Object.defineProperty(window, 'asrsea', {
  25. get: () => asrsea_,
  26. set: value => _asrsea = value
  27. })
  28. }
  29. })()