Jump to Another Music Service

Jump to Another Music Service.

  1. // ==UserScript==
  2. // @name Jump to Another Music Service
  3. // @description Jump to Another Music Service.
  4. // @author to
  5. // @namespace https://github.com/to
  6. // @license MIT
  7. // @version 0.3
  8. //
  9. // @match https://music.amazon.co.jp/*
  10. // @match https://music.apple.com/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=odesli.co
  12. // @connect song.link
  13. //
  14. // @grant GM_openInTab
  15. // @grant GM_xmlhttpRequest
  16. // ==/UserScript==
  17.  
  18. const MARKET = 'JP';
  19. const PLATFORM = 'spotify';
  20. const OPEN_IN_TAB = true;
  21.  
  22. GM_xmlhttpRequest({
  23. url: `https://api.song.link/v1-alpha.1/links?userCountry=${MARKET}&url=${encodeURIComponent(location.href)}`,
  24. onload: function(r){
  25. r = JSON.parse(r.responseText);
  26. try{
  27. let url = r.linksByPlatform[PLATFORM].url;
  28. OPEN_IN_TAB?
  29. GM_openInTab(url) :
  30. (location.href = url);
  31. }catch{
  32. alert('NOT FOUND;;');
  33. }
  34. }});

QingJ © 2025

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