Greasy Fork

Greasy Fork is available in English.

字幕组字幕下载页面扩展脚本

给字幕组的字幕下载页面增加一个字幕版本对应的视频文件下载链接

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name            字幕组字幕下载页面扩展脚本
// @icon            http://www.rrys2019.com/favicon.ico
// @author          LisonFan
// @version         1.0.1
// @description     给字幕组的字幕下载页面增加一个字幕版本对应的视频文件下载链接
// @match           http://www.rrys2019.com/subtitle/*
// @grant           none
// @license         MIT License
// @require         https://lib.baomitu.com/jquery/3.4.1/jquery.min.js
// @namespace https://github.com/LisonFan/
// ==/UserScript==

(function ($) {
    'use strict';

    let subtitleInfoList = $("ul.subtitle-info").find("li")
    $.each(subtitleInfoList, function () {
        let tmpStr = $(this).text()
        if (tmpStr.search(/^版本/g) > -1) {
            let title = tmpStr.substring(3)
            title = title.replace(/(\.zip|\.rar)$/, "")
            let url = "https://rarbg.to/torrents.php?search=" + title
            let a = "<a href='" + url + "' target='_blank' style='color: red;'>" + title + "</a>"
            $(this).html($(this).text().replace(title, a + " <- 点击跳转"))
        }
    })
})(jQuery);