您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
批量下载王者荣耀单英雄页面语音,文件用台词命名。
当前为
// ==UserScript== // @name 王者荣耀音频下载命名 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 批量下载王者荣耀单英雄页面语音,文件用台词命名。 // @author You // @match https://world.honorofkings.com/* // @match https://pvp.qq.com/ip/* // @icon https://www.google.com/s2/favicons?sz=64&domain=honorofkings.com // @grant none // ==/UserScript== (function() { 'use strict'; function downloadAudio(mp3URL, speechText, index) { fetch(mp3URL) .then(response => response.blob()) .then(blob => { const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = `${speechText}.mp3`; link.click(); }) .catch(error => console.error('Error downloading audio:', error)); } function autoDownloadAudio() { const voiceItems = document.querySelectorAll('.dinfo-voice-item'); voiceItems.forEach((voiceItem, index) => { const mp3URL = voiceItem.getAttribute('data-mp3'); const speechText = voiceItem.querySelector('span').textContent.trim(); // 下载音频文件 downloadAudio(mp3URL, speechText, index); }); } // 创建一键下载按钮 const downloadAllButton = document.createElement('button'); downloadAllButton.textContent = '下载该页面所有音频'; downloadAllButton.style.position = 'fixed'; downloadAllButton.style.top = '10px'; downloadAllButton.style.left = '10px'; downloadAllButton.style.zIndex = '999'; downloadAllButton.addEventListener('click', autoDownloadAudio); // 将按钮添加到页面 document.body.appendChild(downloadAllButton); })();