// ==UserScript== // @name 天天动次打次 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.1 // @description 终有一天,人类会变成只会唱歌跳舞的物种!酷狗:✅MV下载 ...,酷我:✅MV下载 ... // @author You // @icon https://bpic.51yuansu.com/pic3/cover/02/36/79/59c241007576b_610.jpg // @require https://scriptcat.org/lib/881/%5E1.2.0/script-statistics.js // @match http*://www.kugou.com/* // @match http*://www.kuwo.cn/* // @match http*://y.qq.com/* // @match http*://music.163.com/* // @match http*://music.91q.com/* // @match http*://music.migu.cn/* // @run-at document-start // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_setValue // @grant GM_getValue // @antifeature tracking // ==/UserScript== (function () { 'use strict'; var obj = { kugou: {}, kuwo: {}, yqq: {}, m163: {}, m91q: {}, migu: {}, }; obj.kugou.run = function () { if (unsafeWindow.jQuery) { obj.statistic(); var url = location.href; if (url.indexOf(".kugou.com/mv/") > 0 || url.indexOf(".kugou.com/mvweb/") > 0) { obj.kugou.mvPage(); } } else { setTimeout(obj.kugou.run, 100); } }; obj.kuwo.run = function () { if (unsafeWindow?.__NUXT__?.data && unsafeWindow?.$nuxt?._router) { var url = location.href; var routePath = unsafeWindow.__NUXT__.routePath; if (routePath == location.pathname && url.indexOf(routePath) > 0) { obj.statistic(); if (url.indexOf(".kuwo.cn/mvplay/") > 0) { obj.kuwo.mvPage(); }; } else { location.reload(); } unsafeWindow.$nuxt._router.afterHooks.push(function () { setTimeout(obj.kuwo.run, 500); }); } else { setTimeout(obj.kuwo.run, 500); } }; obj.yqq.run = function () { obj.statistic(); }; obj.m163.run = function () { obj.statistic(); }; obj.m91q.run = function () { obj.statistic(); }; obj.migu.run = function () { obj.statistic(); }; obj.kugou.mvPage = function () { unsafeWindow.jQuery(document).ajaxComplete(function (event, xhr, options) { var requestUrl = options.url; if (requestUrl.indexOf("/play/mv") > -1) { var response = xhr.responseText; try { response = JSON.parse(response); } catch (e) { } if (response && response.status == 1) { var mvinfo = {}, definition = { fhd: "1080P 全高清", hd: "720P 高清", qhd: "540P 标清", sd: "480P 标清", ld: "360P 普清" }; const { info, play, privilege } = response.data; Object.keys(info.h264).forEach(function (template) { if (info.h264[template]) { const [k, v] = template.split("_"); if (!mvinfo[k]) { mvinfo[k] = {}; mvinfo[k].definition = definition[k] || "未知"; } mvinfo[k][v] = info.h264[template]; if (v == "hash") { Object.assign(mvinfo[k], play[info.h264[template]]); } } }); unsafeWindow.jQuery(".mv_appdownloadBtn").empty().attr({ target: "", href: "javascript:;", title: "MV 下载" }).on("click", function () { var t = unsafeWindow.dialog.list; t.downloadd = t.downloadd || unsafeWindow.dialog({ title: "下載MV", skin: "download_popup", fixed: !0, content: [ '
下载MV需要在酷狗音乐客户端操作