163music

播放那些因版权无法播放的云音乐

  1. // ==UserScript==
  2. // @name 163music
  3. // @namespace http://ouo.us/
  4. // @version 1.5
  5. // @description 播放那些因版权无法播放的云音乐
  6. // @author pojtt
  7. // @match *://music.163.com/*
  8. // @grant GM_addStyle
  9. // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. var song = function() {
  14. if ($("a.u-btni-play") && $("a.u-btni-play").length>0) {
  15. $("a.u-btni-play").html('<i>喵阅播放</i>');
  16. $("a.u-btni-play").attr('title','使用喵阅播放♪');
  17. $("a.u-btni-play").removeClass('u-btni-play-dis');
  18. $("a.u-btni-play").attr('onclick',"window.open('http://ouo.us/fm/163/?id="+$("a.u-btni-play").parent().attr("data-rid")+"#min','163','height=478,width=333,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');");
  19. } else {
  20. $("em.f-ff2").after('<a title="使用喵阅播放♪" onclick="window.open(\'http://ouo.us/fm/163/?id='+$("a.u-btni-addply").attr("data-res-id")+'#min\',\'163\',\'height=478,width=333,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no\');"><img src="//ooo.0o0.ooo/2017/05/09/591159a158823.png"></a>');
  21. }
  22. };
  23. var list = function() {
  24. if ($(".m-table") && $(".m-table").length>0) {
  25. GM_addStyle("div[class^='auto-']{display:none}.m-table .js-dis *{color:#5791B5!important}");
  26. $(".m-table tr.js-dis").each(function(){
  27. var $ply = $(this).find("span.ply");
  28. $ply.attr('style','opacity:1;cursor:pointer');
  29. $ply.attr('title','使用喵阅播放♪');
  30. $ply.attr('onclick',"window.open('http://ouo.us/fm/163/?id="+$ply.attr("data-res-id")+"#min','163','height=478,width=333,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');");
  31. });
  32. }
  33. };
  34. var search = function() {
  35. if ($("#m-search") && $("#m-search").length>0) {
  36. GM_addStyle("div[class^='auto-']{display:none}.n-srchrst .srchsongst .js-dis *{color:#5791B5!important}.u-page{display:block!important}");
  37. $("#m-search div.js-dis").each(function(){
  38. var $ply = $(this).find("a.ply");
  39. $ply.attr('style','opacity:1;cursor:pointer');
  40. $ply.attr('title','使用喵阅播放♪');
  41. $ply.attr('onclick',"window.open('http://ouo.us/fm/163/?id="+$ply.attr("data-res-id")+"#min','163','height=478,width=333,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');");
  42. });
  43. $(".u-page a").bind('click', function(){
  44. window.setTimeout(search,345);
  45. });
  46. }
  47. };
  48. var binds = function() {
  49. if (location.href.indexOf('/song')>0) {
  50. song();
  51. } else if (location.href.indexOf('/search')>0) {
  52. window.setTimeout(search,423);
  53. } else if (location.href.indexOf('/my')>0) {
  54. window.setTimeout(list,423);
  55. } else if (location.href.indexOf('/album')>0 || location.href.indexOf('/artist')>0 || location.href.indexOf('/playlist')>0) {
  56. list();
  57. }
  58. };
  59. binds();
  60. $(window).bind('hashchange', function() {
  61. binds();
  62. });
  63. })();