您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
导出完整的QQ歌单信息,用于到其它地方搜索、下载
当前为
// ==UserScript== // @name 导出QQ歌单 // @namespace https://www.柴门.wooddoor/ // @version 0.1 // @description 导出完整的QQ歌单信息,用于到其它地方搜索、下载 // @author 柴门 // @match https://y.qq.com/musicmac/v6/playlist/detail.html?id=* // @grant none // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // ==/UserScript== (function() { 'use strict'; // Your code here... setTimeout(function () {////定时5秒后运行一次 $("#songlist_box").before(`<div style="display:inline;z-index:999;"><textarea style="height:100px;width:100%;" id="songlist__input" readonly="readonly" /><button id="save">尝试保存</button></div>`); $("#songlist__input").val("mid\t歌曲名\t歌手名\tsingermid\tsingerid\talbummid\trid\talbum_name\tsonglist__time\n"); console.log($('.songlist__li').length); $(".songlist__li").each(function(index,domEle){ //console.log($(this).text()); //alert($(this).text()); var mid = $(this).find(".songlist__item").attr("mid");//不知啥,先记录保存下来再说 var title = $(this).find(".mod_songname__name").attr("title");//歌曲名 var singer_name = $(this).find(".singer_name").attr("title");//歌手名,或:$(".singer_name").text(); var singermid = $(this).find(".singer_name").attr("data-singermid");//不知啥,先记录保存下来再说 var singerid = $(this).find(".singer_name").attr("data-singerid");//不知啥,先记录保存下来再说 var albummid = $(this).find(".songlist__album").attr("data-albummid");//不知啥,先记录保存下来再说 var rid = $(this).find(".songlist__album").attr("data-rid");//不知啥,先记录保存下来再说 var album_name = $(this).find(".songlist__album").text();//专辑名 var songlist__time = $(this).find(".songlist__time").text();//歌曲时长 $("#songlist__input").val($("#songlist__input").val() + mid + "\t" + title + "\t" + singer_name + "\t" + singermid + "\t" + singerid + "\t" + albummid + "\t" + rid + "\t" + album_name + "\t" + songlist__time + "\n"); //$("#songlist__input").val( $("#songlist__input").val() + "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\n".format(mid, title, singer_name, singermid, singerid, albummid, rid, album_name, songlist__time) ); }); //============javascript – 将HTML5 textarea内容保存到文件:https://www.jb51.cc/js/159069.html============// function saveTextAsFile() { var textToWrite = $("#songlist__input").val();//document.getElementById('songlist__input').innerHTML; var textFileAsBlob = new Blob([ textToWrite ],{ type: 'text/plain' }); var fileNameToSaveAs = "songlist.xls";//将歌单下载保存为songlist.xls文件 var downloadLink = document.createElement("a"); downloadLink.download = fileNameToSaveAs; downloadLink.innerHTML = "Download File"; if (window.webkitURL != null) { // Chrome allows the link to be clicked without actually adding it to the DOM. downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob); } else { // Firefox requires the link to be added to the DOM before it can be clicked. downloadLink.href = window.URL.createObjectURL(textFileAsBlob); downloadLink.onclick = destroyClickedElement; downloadLink.style.display = "none"; document.body.appendChild(downloadLink); } downloadLink.click(); } var button = document.getElementById('save'); button.addEventListener('click',saveTextAsFile); function destroyClickedElement(event) { // remove the link from the DOM document.body.removeChild(event.target); } //============javascript – 将HTML5 textarea内容保存到文件:https://www.jb51.cc/js/159069.html============// }, 5000) })();