Greasy Fork

Greasy Fork is available in English.

人人字幕链接提取

提取人人字幕组的资源链接

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         人人字幕链接提取
// @namespace    undefined
// @version      0.0.1
// @description  提取人人字幕组的资源链接
// @author       lihao
// @include        http://www.zimuzu.tv/gresource/list/*

// @require      http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js
// @run-at       document-end
// @grant        unsafeWindow
// @grant        GM_setClipboard
// ==/UserScript==

(function() {
    'use strict';
    console.time('testForEach');

    $('.it').each(function (i,ele){        
        replaceThunder($(ele));
    });
    console.timeEnd('testForEach');

    //替换原来的迅雷链接
    function replaceThunder($ele){        
        let links = [];        
        $ele.parents('.media-list').find('a[thunderrestitle]:visible').each(function (_i,a){
            let _a = $(a);
            links.push(a.attributes[6].value);
            _a.before('<a href="'+a.attributes[6].value+'">迅雷</a>');
            _a.remove();
        });
        let all = $('<a style="color: #fff;" >复制全部迅雷链接</a>').on('click',function (e){
            e.preventDefault(); 
            GM_setClipboard(links.join('\n'), { type: 'text', mimetype: 'text/plain'});            
        });
        $ele.append(all);
    }
})();