字幕助手: 一键视频字幕下载器

一键从多个视频平台轻松下载字幕

当前为 2025-01-13 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         SubtitleEase: One-Click Video Subtitle Downloader
// @name:zh-CN   字幕助手: 一键视频字幕下载器
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  Easily download subtitles from various video platforms with one click
// @description:zh-CN 一键从多个视频平台轻松下载字幕
// @author       RoyWU
// @license      MIT
// @match        *://*.youtube.com/*
// @match        *://*.viki.com/*
// @match        *://*.viu.com/*
// @match        *://*.kocowa.com/*
// @match        *://*.wetv.vip/*
// @match        *://*.bilibili.com/*
// @match        *://*.facebook.com/*
// @match        *://*.ted.com/*
// @match        *://*.altbalaji.com/*
// @match        *://*.brightcove.com/*
// @match        *://*.dailymotion.com/*
// @match        *://*.dimsum.my/*
// @match        *://*.ondemandchina.com/*
// @match        *://*.erosnow.com/*
// @match        *://*.drive.google.com/*
// @match        *://*.hotstar.com/*
// @match        *://*.iq.com/*
// @match        *://*.iflix.com/*
// @match        *://*.metopera.org/*
// @match        *://*.mgtv.com/*
// @match        *://*.ondemandkorea.com/*
// @match        *://*.tv.naver.com/*
// @match        *://*.tv.nrk.no/*
// @match        *://*.line.me/*
// @match        *://*.tubitv.com/*
// @match        *://*.vk.com/*
// @match        *://*.vlive.tv/*
// @match        *://*.vimeo.com/*
// @match        *://*.voot.com/*
// @match        *://*.weverse.io/*
// @match        *://*.zee5.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=downsub.com
// @grant        GM_registerMenuCommand
// @grant        GM_openInTab
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    const DOWNSUB_URL = 'https://downsub.com/';

    // 获取当前标签页的真实URL
    function getCurrentTabUrl() {
        // 检查是否在主框架中
        if (window.self !== window.top) {
            return null;  // 如果不是主框架,返回 null
        }
        // 返回地址栏中的 URL
        return window.top.location.href;
    }

    // 打开 DownSub 标签页
    function openDownSubTab() {
        const currentURL = getCurrentTabUrl();
        // 只有在获取到有效URL时才继续
        if (currentURL) {
            const downsubURL = `${DOWNSUB_URL}?url=${encodeURIComponent(currentURL)}`;
            GM_openInTab(downsubURL, { active: true });
        }
    }

    // 注册菜单命令
    GM_registerMenuCommand("下载字幕", openDownSubTab);

})();