您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically downloads ChatGPT's TTS audio whenever playback is triggered.
// ==UserScript== // @name ChatGPT TTS Grabber // @namespace https://github.com/dudebot/greasyfork-scripts/tree/main/ChatGPT // @version 1.0.0 // @description Automatically downloads ChatGPT's TTS audio whenever playback is triggered. // @author dudebot // @license MIT // @supportURL https://github.com/dudebot/greasyfork-scripts/issues // @match https://chat.openai.com/* // @match https://chatgpt.com/* // @grant none // ==/UserScript== (() => { const OrigMS = window.MediaSource; window.MediaSource = function() { const ms = new OrigMS(); const origAdd = ms.addSourceBuffer.bind(ms); ms.addSourceBuffer = mime => { const sb = origAdd(mime); if (mime.startsWith('audio/')) { const chunks = []; const origAppend = sb.appendBuffer.bind(sb); sb.appendBuffer = buf => { chunks.push(buf.slice(0)); origAppend(buf); }; // when the player calls endOfStream: ms.addEventListener('sourceended', () => { const blob = new Blob(chunks, { type: mime }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `chatgpt-${Date.now()}.${mime.split('/')[1]}`; a.click(); }); } return sb; }; return ms; }; window.MediaSource.prototype = OrigMS.prototype; MediaSource.isTypeSupported = OrigMS.isTypeSupported; })();