// ==UserScript== // @name Yinyuetai // @author hyk // @namespace bengda@outlook.com // @description 免积分,免登录,既可观看、下载高清MV // @version 0.0.1 // @create 2016-03-28 // @lastmodified 2016-03-29 // @include http://v.yinyuetai.com/video/* // @include http://v.yinyuetai.com/playlist/* // @copyright 2016+, hyk // @require http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js // @grant unsafeWindow // @grant GM_setClipboard // @grant GM_xmlhttpRequest // @icon // @downloadURL none // ==/UserScript== (function () { var dhost = location.hostname, Lc = location, lurl = Lc.href; var win = (typeof unsafeWindow == 'undefined') ? window : unsafeWindow; var _Q = function (d) { return document.querySelector(d) }, _Qa = function (d) { return document.querySelectorAll(d) }; var DM = function (m) { return lurl.toLowerCase().indexOf(m) > 0; }; function Log(l) { //调试用 console.log(l); } //定义各大浏览器识别 var OP = function () { return window.opera }, GC = function () { return window.chrome }, FF = function () { return window.sidebar }; var $OP = function () { if (OP()) return $ = jQuery; }; //O下$修复 // 参考源:plinfo.js,loader.js。By Yulei 2013.05.07 function YYT() { //音悦台,免登录、积分、客户端 if (!OP()) { var tbk = 'target="_blank"'; $('div.pl_title.fl').after('标清高清超清'); $('#Ytai').mouseenter(function () { Yyt($('.videoinfobox').attr('videoid') || $('.play a').eq(0).attr('href').match(/\d+/)[0]); }); function Yyt(Vid,index) {//此处修改自Music liker for beauty ByYulei GM_xmlhttpRequest({ url: 'http://www.yinyuetai.com/api/info/get-video-urls?videoId=' + Vid, method: "get", onload: function (y) { var r = $.parseJSON(y.responseText); if(DM('/playlist/')){ var oSpan=$("span.mv-quality-icon").eq(index); r.hcVideoUrl ? oSpan.find("a.hc").attr('href', r.hcVideoUrl).show() : oSpan.find("a.hc").hide(); r.hdVideoUrl ? oSpan.find("a.hd").attr('href', r.hdVideoUrl).show() : oSpan.find("a.hd").hide(); r.heVideoUrl ? oSpan.find("a.he").attr('href', r.heVideoUrl).show() : oSpan.find("a.he").hide(); }else{ r.hcVideoUrl ? $('#p1').attr('href', r.hcVideoUrl).show() : $('#p1').hide(); r.hdVideoUrl ? $('#p2').attr('href', r.hdVideoUrl).show() : $('#p2').hide(); r.heVideoUrl ? $('#p3').attr('href', r.heVideoUrl).show() : $('#p3').hide(); } } }) } } if(DM('/playlist/')){ var MVlist=_Qa(".mvbox_list .mv_picBox"); Log(MVlist); $(".mvInfo_row01_left").after("悦单列表地址"); $("#ydList").mouseover(function(){ $(this).css({"backgroundColor":"404040",color:"#27d5bf"}); }); $("#ydList").mouseout(function(){ $(this).css({"backgroundColor":"#333",color:"white"}); }); $("#ydList").click(function(e){ if($("ul.MV_List li").length==0){ $("ul.MV_List").css({"left":e.clientX+15,"top":e.clientY}); for(var i=0;i"+(i+1)+"

"+MVlist[i].getAttribute('data-title')+"

hehdhc"); // alert(MVlist[i].getAttribute('data-id'));//不要使用attr方法 Yyt(MVlist[i].getAttribute('data-id'),i); } } if($("ul.MV_List").is(":visible")){ $("ul.MV_List").hide(); }else{ $("ul.MV_List").show(); } }); Log($("ul.MV_List a.mv_URL")); } } if (!window.sidebar) { window.addEventListener('DOMContentLoaded', Yu, false); } else { YYT(); }; })();