Sleazy Fork is available in English.

自动获取JAVLIB的字幕

自动获取JAVLIB的字幕,暂时只支持JAVLIB。

Fra og med 03.07.2017. Se den nyeste version.

// ==UserScript==
// @name         自动获取JAVLIB的字幕
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  自动获取JAVLIB的字幕,暂时只支持JAVLIB。
// @author       bestYy
// @include     http*://*javlibrary.com/*
// @include     http*://*javlib.com/*
// @include     http*://*javl10.com/*
// @include     http*://*jav11b.com/*
// @include     http*://*13vlib.com/*
// @run-at      document-end
// @grant       GM_xmlhttpRequest
// @grant       GM_addStyle
// @require      https://code.jquery.com/jquery-latest.js
// ==/UserScript==

(function() {
    'use strict';
    GM_addStyle("#divZm{margin-left:70px;}");
    var my = {
    	getFh:function(){
    		var fh = $("td.text").html();
    		console.log(fh);
    		return fh;
    	},
    	getZm:function(fh){
    		GM_xmlhttpRequest({
    			method:"GET",
    			url:"http://www.163sub.com/Search?id=" + fh,
    			onload:function(result){
    				 var doc = result.responseText;
    				 var re = /download\/\w+-\w+-\w+-\w+-\w+'/;
    				 var arr = re.exec(doc);
    				 if(!arr){
    				 	$("#video_cast").after("<div id='divZm'>暂无字幕</div>");
    				 	return;
    				 }
    				 var zm = arr[0].slice(0, -1);
					 $("#video_cast").after("<div id='divZm' '><a href='http://www.163sub.com/"+zm+"' target='_blank'>字幕下载</a></div>");
    			},
    			onerror:function(e){
    				console.log('搜索字幕出现错误');
    			}
    		});
    	}
    };
    var fh = my.getFh();
    my.getZm(fh);
})();