Zoom 网页字幕下载器

下载 Zoom 网页版会议实时字幕为 txt 文件

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Zoom 网页字幕下载器
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  下载 Zoom 网页版会议实时字幕为 txt 文件
// @author       YJ
// @match        https://*.zoom.us/*
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    // 创建下载按钮
    function createDownloadButton() {
        const btn = document.createElement('button');
        btn.innerText = '📥 下载字幕 (.txt)';
        btn.style.position = 'fixed';
        btn.style.top = '80px';
        btn.style.right = '20px';
        btn.style.zIndex = 9999;
        btn.style.padding = '10px 15px';
        btn.style.backgroundColor = '#0f62fe';
        btn.style.color = '#fff';
        btn.style.border = 'none';
        btn.style.borderRadius = '6px';
        btn.style.cursor = 'pointer';
        btn.style.fontSize = '14px';
        btn.onclick = downloadTranscript;
        document.body.appendChild(btn);
    }

    // 提取并下载字幕
    function downloadTranscript() {
        const items = document.querySelectorAll('.lt-full-transcript__item');
        if (items.length === 0) {
            alert('未找到字幕内容,请确保字幕窗口已打开。');
            return;
        }

        let transcript = '';
        items.forEach(item => {
            const time = item.querySelector('.lt-full-transcript__time')?.innerText?.trim() || '';
            const name = item.querySelector('.lt-full-transcript__display-name')?.innerText?.trim() || '';
            const message = item.querySelector('.lt-full-transcript__message')?.innerText?.trim() || '';
            transcript += `[${time}] ${name ? name + ': ' : ''}${message}\n`;
        });

        const blob = new Blob([transcript], { type: 'text/plain;charset=utf-8' });
        const url = URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = 'zoom_transcript.txt';
        a.click();
        URL.revokeObjectURL(url);
    }

    // 等待页面加载字幕元素
    function waitForTranscript() {
        const checkInterval = setInterval(() => {
            const exists = document.querySelector('.lt-full-transcript__item');
            if (exists) {
                clearInterval(checkInterval);
                createDownloadButton();
            }
        }, 1000);
    }

    waitForTranscript();
})();