Greasy Fork is available in English.

SubtitleEase: One-Click Video Subtitle Downloader

Easily download subtitles from various video platforms with one click

  1. // ==UserScript==
  2. // @name SubtitleEase: One-Click Video Subtitle Downloader
  3. // @name:zh-CN 字幕助手: 一键视频字幕下载器
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.6
  6. // @description Easily download subtitles from various video platforms with one click
  7. // @description:zh-CN 一键从多个视频平台轻松下载字幕
  8. // @author RoyWU
  9. // @license MIT
  10. // @match *://*.youtube.com/*
  11. // @match *://*.viki.com/*
  12. // @match *://*.viu.com/*
  13. // @match *://*.kocowa.com/*
  14. // @match *://*.wetv.vip/*
  15. // @match *://*.bilibili.com/*
  16. // @match *://*.facebook.com/*
  17. // @match *://*.ted.com/*
  18. // @match *://*.altbalaji.com/*
  19. // @match *://*.brightcove.com/*
  20. // @match *://*.dailymotion.com/*
  21. // @match *://*.dimsum.my/*
  22. // @match *://*.ondemandchina.com/*
  23. // @match *://*.erosnow.com/*
  24. // @match *://*.drive.google.com/*
  25. // @match *://*.hotstar.com/*
  26. // @match *://*.iq.com/*
  27. // @match *://*.iflix.com/*
  28. // @match *://*.metopera.org/*
  29. // @match *://*.mgtv.com/*
  30. // @match *://*.ondemandkorea.com/*
  31. // @match *://*.tv.naver.com/*
  32. // @match *://*.tv.nrk.no/*
  33. // @match *://*.line.me/*
  34. // @match *://*.tubitv.com/*
  35. // @match *://*.vk.com/*
  36. // @match *://*.vlive.tv/*
  37. // @match *://*.vimeo.com/*
  38. // @match *://*.voot.com/*
  39. // @match *://*.weverse.io/*
  40. // @match *://*.zee5.com/*
  41. // @icon https://www.google.com/s2/favicons?sz=64&domain=downsub.com
  42. // @grant GM_registerMenuCommand
  43. // @grant GM_openInTab
  44. // @grant GM_addStyle
  45. // ==/UserScript==
  46.  
  47. (function() {
  48. 'use strict';
  49.  
  50. const DOWNSUB_URL = 'https://downsub.com/';
  51.  
  52. // 获取当前标签页的真实URL
  53. function getCurrentTabUrl() {
  54. // 检查是否在主框架中
  55. if (window.self !== window.top) {
  56. return null; // 如果不是主框架,返回 null
  57. }
  58. // 返回地址栏中的 URL
  59. return window.top.location.href;
  60. }
  61.  
  62. // 打开 DownSub 标签页
  63. function openDownSubTab() {
  64. const currentURL = getCurrentTabUrl();
  65. // 只有在获取到有效URL时才继续
  66. if (currentURL) {
  67. const downsubURL = `${DOWNSUB_URL}?url=${encodeURIComponent(currentURL)}`;
  68. GM_openInTab(downsubURL, { active: true });
  69. }
  70. }
  71.  
  72. // 注册菜单命令
  73. GM_registerMenuCommand("下载字幕", openDownSubTab);
  74.  
  75. })();