mirror of
https://github.com/fireinrain/JHS-enhance.git
synced 2026-09-28 07:36:38 +08:00
移除跳转播放无用的地址
This commit is contained in:
Vendored
+40
-190
@@ -1130,7 +1130,6 @@
|
||||
if (typeof GM_info === "undefined" || GM_info.scriptHandler !== "Tampermonkey" || compareVersions(GM_info.version, "5.3.2") < 0) return;
|
||||
const GM_xmlhttpRequestOrig = GM_xmlhttpRequest;
|
||||
const GM_xmlHttpRequestOrig = GM2.xmlHttpRequest;
|
||||
|
||||
function compareVersions(v1, v2) {
|
||||
const parts1 = v1.split(".").map(Number);
|
||||
const parts2 = v2.split(".").map(Number);
|
||||
@@ -1143,7 +1142,6 @@
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function GM_xmlhttpRequestWrapper(odetails) {
|
||||
if (odetails.redirect !== void 0) {
|
||||
return GM_xmlhttpRequestOrig(odetails);
|
||||
@@ -1193,7 +1191,6 @@
|
||||
};
|
||||
return handleRedirects(details);
|
||||
}
|
||||
|
||||
function GM_xmlHttpRequestWrapper(odetails) {
|
||||
let abort;
|
||||
const p = new Promise((resolve, reject) => {
|
||||
@@ -1234,7 +1231,6 @@
|
||||
};
|
||||
return p;
|
||||
}
|
||||
|
||||
GM_xmlhttpRequest = GM_xmlhttpRequestWrapper;
|
||||
scope.GM_xmlhttpRequestOrig = GM_xmlhttpRequestOrig;
|
||||
const gopd = Object.getOwnPropertyDescriptor(GM2, "xmlHttpRequest");
|
||||
@@ -2692,7 +2688,6 @@ ${value}\r
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const DMM_GRAPHQL_URL = "https://api.video.dmm.co.jp/graphql";
|
||||
const dmmGraphQLKeyword = (code) => {
|
||||
const match = String(code || "").trim().toUpperCase().match(/^([A-Z0-9]{2,10})-(\d{1,6})$/);
|
||||
@@ -2850,13 +2845,11 @@ ${value}\r
|
||||
for (const quality of priorityOrder) if (availableSet.has(quality)) return quality;
|
||||
return dmmVideoQualityList[0];
|
||||
}, CACHE_KEY = "jhs_dmm_video";
|
||||
|
||||
class DmmVideoFetcher {
|
||||
constructor(carNum2, showErrorMessages = true) {
|
||||
this.carNum = carNum2;
|
||||
this.showErrorMessages = showErrorMessages;
|
||||
}
|
||||
|
||||
_checkCache() {
|
||||
const cachedData = localStorage.getItem(CACHE_KEY) ? JSON.parse(localStorage.getItem(CACHE_KEY)) : {};
|
||||
if (cachedData[this.carNum]) {
|
||||
@@ -2865,14 +2858,12 @@ ${value}\r
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
_updateCache(videoMap) {
|
||||
const cachedData = localStorage.getItem(CACHE_KEY) ? JSON.parse(localStorage.getItem(CACHE_KEY)) : {};
|
||||
cachedData[this.carNum] = videoMap;
|
||||
clog.debug("成功解析出预览视频并已缓存:", videoMap);
|
||||
localStorage.setItem(CACHE_KEY, JSON.stringify(cachedData));
|
||||
}
|
||||
|
||||
async _searchContentIds() {
|
||||
const carNum2 = this.carNum, carNumNoHyphen = carNum2.replace(/-/g, ""), keywordAttempts = [{
|
||||
keyword: carNum2.replace("-", "00"),
|
||||
@@ -2989,7 +2980,6 @@ ${value}\r
|
||||
if (0 === Object.keys(finalQualityMap).length) throw new Error("未找到匹配要求的预览画质视频");
|
||||
return finalQualityMap;
|
||||
}
|
||||
|
||||
async _searchViaGraphQL() {
|
||||
clog.debug("尝试通过 GraphQL API 搜索视频...");
|
||||
const videoMap = await getDmmGraphQLVideoUrls(this.carNum);
|
||||
@@ -3007,7 +2997,6 @@ ${value}\r
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async fetchVideo() {
|
||||
const cachedResult = this._checkCache();
|
||||
if (cachedResult) return cachedResult;
|
||||
@@ -3053,7 +3042,6 @@ ${value}\r
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDmmVideo = async (carNum2, showErrorMessages = true) => new DmmVideoFetcher(carNum2, showErrorMessages).fetchVideo();
|
||||
class AutoPagePlugin extends BasePlugin {
|
||||
constructor() {
|
||||
@@ -4245,12 +4233,6 @@ ${value}\r
|
||||
<input id="jableUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span class="setting-label">域名 - Avgle:</span>
|
||||
<div class="form-content">
|
||||
<input id="avgleUrl">
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span class="setting-label">域名 - JavTrailer:</span>
|
||||
<div class="form-content">
|
||||
@@ -4684,10 +4666,12 @@ ${value}\r
|
||||
$("#enableHandleSvg").prop("checked", !settingObj.enableHandleSvg || settingObj.enableHandleSvg === YES);
|
||||
$("#enableSiteSvg").prop("checked", !settingObj.enableSiteSvg || settingObj.enableSiteSvg === YES);
|
||||
$("#enableCopySvg").prop("checked", !settingObj.enableCopySvg || settingObj.enableCopySvg === YES);
|
||||
const otherSitePlugin = this.getBean("OtherSitePlugin"), missAvUrl = await otherSitePlugin.getMissAvUrl(), jableUrl = await otherSitePlugin.getjableUrl(), avgleUrl = await otherSitePlugin.getAvgleUrl(), javTrailersUrl = await otherSitePlugin.getJavTrailersUrl(), av123Url = await otherSitePlugin.getAv123Url(), javDbUrl = await otherSitePlugin.getJavDbUrl(), javBusUrl = await otherSitePlugin.getJavBusUrl(), supJavUrl = await otherSitePlugin.getSupJavUrl();
|
||||
const otherSitePlugin = this.getBean("OtherSitePlugin"), missAvUrl = await otherSitePlugin.getMissAvUrl(),
|
||||
jableUrl = await otherSitePlugin.getjableUrl(), javTrailersUrl = await otherSitePlugin.getJavTrailersUrl(),
|
||||
av123Url = await otherSitePlugin.getAv123Url(), javDbUrl = await otherSitePlugin.getJavDbUrl(),
|
||||
javBusUrl = await otherSitePlugin.getJavBusUrl(), supJavUrl = await otherSitePlugin.getSupJavUrl();
|
||||
$("#missAvUrl").val(missAvUrl);
|
||||
$("#jableUrl").val(jableUrl);
|
||||
$("#avgleUrl").val(avgleUrl);
|
||||
$("#javTrailersUrl").val(javTrailersUrl);
|
||||
$("#av123Url").val(av123Url);
|
||||
$("#javDbUrl").val(javDbUrl);
|
||||
@@ -5201,7 +5185,6 @@ ${value}\r
|
||||
settingObj.webDavPassword = $("#webDavPassword").val();
|
||||
settingObj.missAvUrl = $("#missAvUrl").val().replace(/\/$/, "");
|
||||
settingObj.jableUrl = $("#jableUrl").val().replace(/\/$/, "");
|
||||
settingObj.avgleUrl = $("#avgleUrl").val().replace(/\/$/, "");
|
||||
settingObj.javTrailersUrl = $("#javTrailersUrl").val().replace(/\/$/, "");
|
||||
settingObj.av123Url = $("#av123Url").val().replace(/\/$/, "");
|
||||
settingObj.javDbUrl = $("#javDbUrl").val().replace(/\/$/, "");
|
||||
@@ -5239,7 +5222,6 @@ ${value}\r
|
||||
this.getBean("BlacklistPlugin").resetBtnTip();
|
||||
this.getBean("BlacklistPlugin").reloadTable();
|
||||
}
|
||||
|
||||
async loadMarkDeleteList() {
|
||||
const markedList = await storageManager.forage.getItem("markedDeleteList") || [];
|
||||
const $list = $("#markDeleteList");
|
||||
@@ -7384,28 +7366,22 @@ ${value}\r
|
||||
$secTitle.html(newHTML);
|
||||
}
|
||||
}
|
||||
|
||||
class JavPackSubtitle {
|
||||
static escapeHtml(value = "") {
|
||||
return String(value).replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
||||
}
|
||||
|
||||
static sanitizeName(value = "") {
|
||||
return String(value).replace(/[\\/:*?"<>|]/g, "").replace(/\s+/g, " ").trim();
|
||||
}
|
||||
|
||||
static isSubtitleFile(file = {}) {
|
||||
return /\.(srt|ass|ssa|vtt|sub)$/i.test(file.n || "");
|
||||
}
|
||||
|
||||
static buildDefaultKeyword(details = {}) {
|
||||
return this.sanitizeName(details.code || "") || this.sanitizeName([details.code, details.title].filter(Boolean).join(" ")) || document.title;
|
||||
}
|
||||
|
||||
static buildSearchKeywords(details = {}) {
|
||||
return [this.buildDefaultKeyword(details)].filter(Boolean);
|
||||
}
|
||||
|
||||
static buildSubtitleBaseName(details = {}) {
|
||||
var _a;
|
||||
if ((_a = window.JavPackMatch115Console) == null ? void 0 : _a.buildRename) {
|
||||
@@ -7413,31 +7389,25 @@ ${value}\r
|
||||
}
|
||||
return this.sanitizeName([details.code, details.title].filter(Boolean).join(" ")) || this.buildDefaultKeyword(details);
|
||||
}
|
||||
|
||||
static buildSubtitleFilename(details = {}, item = {}) {
|
||||
const ext = this.sanitizeName(item.ext || "srt").replace(/^\.+/, "") || "srt";
|
||||
return `${this.buildSubtitleBaseName(details)}.${ext}`;
|
||||
}
|
||||
|
||||
static clearPreviewCache() {
|
||||
this.previewCache.clear();
|
||||
}
|
||||
|
||||
static async checkSubInCloud(req115, cid) {
|
||||
if (!req115 || !cid) return false;
|
||||
const res = await req115.filesAll(cid);
|
||||
return ((res == null ? void 0 : res.data) || []).some((file) => this.isSubtitleFile(file));
|
||||
}
|
||||
|
||||
static getReq115() {
|
||||
return window.Req115 || null;
|
||||
}
|
||||
|
||||
static getTargetCid() {
|
||||
var _a, _b;
|
||||
return ((_a = document.querySelector(".x-match-cont .zymatch-item [data-cid]")) == null ? void 0 : _a.dataset.cid) || ((_b = document.querySelector(".x-match-cont .zymatch-item")) == null ? void 0 : _b.dataset.cid) || "";
|
||||
}
|
||||
|
||||
static async find115Cid(code) {
|
||||
if (!code) return "";
|
||||
const req115 = this.getReq115();
|
||||
@@ -7456,7 +7426,6 @@ ${value}\r
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
static async preload115Matches(code) {
|
||||
this.cached115Matches = [];
|
||||
this.current115Cids = [];
|
||||
@@ -7527,7 +7496,6 @@ ${value}\r
|
||||
attributeFilter: ["data-has-subtitle", "data-subtitle-files"]
|
||||
});
|
||||
}
|
||||
|
||||
static modalTemplate(defaultKw) {
|
||||
return `
|
||||
<div class="pdb-sub-modal">
|
||||
@@ -7641,11 +7609,9 @@ ${value}\r
|
||||
});
|
||||
performSearch(defaultKw);
|
||||
}
|
||||
|
||||
static requestText(url) {
|
||||
return window.gmHttp.get(url);
|
||||
}
|
||||
|
||||
static async searchXunlei(kw) {
|
||||
const root = await this.requestText(`https://api-shoulei-ssl.xunlei.com/oracle/subtitle?name=${encodeURIComponent(kw)}`);
|
||||
if (!root || root.code !== 0 || !Array.isArray(root.data)) return [];
|
||||
@@ -7653,7 +7619,6 @@ ${value}\r
|
||||
const labeledResults = await Promise.all(results.map((item) => this.labelXunleiChineseSubtitle(item)));
|
||||
return labeledResults.filter(Boolean);
|
||||
}
|
||||
|
||||
static normalizeXunleiResult(item = {}) {
|
||||
const rawLanguages = item.languages ?? item.Languages ?? item.langs ?? item.Langs ?? item.language ?? item.Language ?? [];
|
||||
return {
|
||||
@@ -7665,7 +7630,6 @@ ${value}\r
|
||||
provider: "迅雷"
|
||||
};
|
||||
}
|
||||
|
||||
static async labelXunleiChineseSubtitle(item) {
|
||||
if (this.isWantedChineseSubtitle(item)) return item;
|
||||
if (!item.url) return null;
|
||||
@@ -7676,7 +7640,6 @@ ${value}\r
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static detectChineseSubtitleLanguage(text = "") {
|
||||
const sample = String(text).slice(0, 12e3);
|
||||
if (!/[\u3400-\u9fff]/.test(sample)) return "";
|
||||
@@ -7685,7 +7648,6 @@ ${value}\r
|
||||
if (simplifiedCount === 0 && traditionalCount === 0) return "";
|
||||
return traditionalCount > simplifiedCount ? "繁中" : "简中";
|
||||
}
|
||||
|
||||
static async searchSubtitleCat(kw) {
|
||||
const searchUrl = `${this.SUBTITLECAT_ORIGIN}/index.php?search=${encodeURIComponent(kw)}`;
|
||||
const searchHtml = await this.requestText(searchUrl);
|
||||
@@ -7699,7 +7661,6 @@ ${value}\r
|
||||
}));
|
||||
return languageGroups.flat();
|
||||
}
|
||||
|
||||
static parseSubtitleCatSearch(html) {
|
||||
const doc = new DOMParser().parseFromString(html, "text/html");
|
||||
return [...doc.querySelectorAll("table.sub-table tbody tr")].flatMap((row) => {
|
||||
@@ -7713,7 +7674,6 @@ ${value}\r
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
static parseSubtitleCatLanguages(html, entry) {
|
||||
const doc = new DOMParser().parseFromString(html, "text/html");
|
||||
return [...doc.querySelectorAll(".sub-single")].flatMap((node) => {
|
||||
@@ -7732,21 +7692,18 @@ ${value}\r
|
||||
}];
|
||||
});
|
||||
}
|
||||
|
||||
static isWantedChineseSubtitle(item = {}) {
|
||||
if (item.provider === "SubtitleCat") return this.SUBTITLECAT_CHINESE_LANGUAGES.has(item.languageCode);
|
||||
const language = Array.isArray(item.languages) ? item.languages.join(" ") : String(item.languages || "");
|
||||
const name2 = `${item.name || ""} ${item.extra_name || ""}`;
|
||||
return /(zh[-_]?cn|zh[-_]?tw|chs|cht|chinese\s*(simplified|traditional)|简体|繁体|繁體|简中|繁中)/i.test(`${language} ${name2}`);
|
||||
}
|
||||
|
||||
static sortResults(dataList, kw = "", details = {}) {
|
||||
const kwClean = kw.toLowerCase().replace(/[-_.\s]/g, "");
|
||||
const tokens = kw.toLowerCase().split(/[-_.\s]+/).filter((word) => word.length > 1);
|
||||
const codeClean = String(details.code || kw).toLowerCase().replace(/[-_.\s]/g, "");
|
||||
return [...dataList].filter((item) => this.isWantedChineseSubtitle(item)).sort((a, b) => this.scoreResult(b, kwClean, tokens, codeClean) - this.scoreResult(a, kwClean, tokens, codeClean));
|
||||
}
|
||||
|
||||
static scoreResult(item, kwClean, tokens, codeClean = "") {
|
||||
const name2 = (item.name || item.extra_name || "").toLowerCase();
|
||||
const compactName = name2.replace(/[-_.\s]/g, "");
|
||||
@@ -7793,7 +7750,6 @@ ${value}\r
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
static renderRow(item, index, highlightRegex) {
|
||||
var _a;
|
||||
const lang = ((_a = item.languages) == null ? void 0 : _a[0]) || "未知";
|
||||
@@ -7866,7 +7822,6 @@ ${value}\r
|
||||
btn.style.opacity = "1";
|
||||
}
|
||||
}
|
||||
|
||||
static setActivePreviewRow(overlay, btn) {
|
||||
overlay.querySelectorAll(".pdb-sub-tr.is-previewing").forEach((row2) => {
|
||||
row2.classList.remove("is-previewing");
|
||||
@@ -7877,13 +7832,11 @@ ${value}\r
|
||||
row.classList.add("is-previewing");
|
||||
row.setAttribute("aria-current", "true");
|
||||
}
|
||||
|
||||
static decodeSubtitle(buffer) {
|
||||
let text = new TextDecoder("utf-8").decode(buffer);
|
||||
if ((text.match(/\uFFFD/g) || []).length > 3) text = new TextDecoder("gbk").decode(buffer);
|
||||
return text;
|
||||
}
|
||||
|
||||
static fetchBinaryCached(url) {
|
||||
if (this.previewCache.has(url)) return Promise.resolve(this.previewCache.get(url));
|
||||
return this.fetchBinary(url).then((buffer) => {
|
||||
@@ -7891,7 +7844,6 @@ ${value}\r
|
||||
return buffer;
|
||||
});
|
||||
}
|
||||
|
||||
static fetchBinary(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
_GM_xmlhttpRequest({
|
||||
@@ -7906,7 +7858,6 @@ ${value}\r
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static downloadBuffer(buffer, filename) {
|
||||
const blob = new Blob([buffer], {type: "application/octet-stream"});
|
||||
const link = document.createElement("a");
|
||||
@@ -7915,7 +7866,6 @@ ${value}\r
|
||||
link.click();
|
||||
URL.revokeObjectURL(link.href);
|
||||
}
|
||||
|
||||
static uploadSubtitle(args) {
|
||||
return args.req115.queueMutation("上传字幕", () => this.uploadSubtitleNow(args));
|
||||
}
|
||||
@@ -7937,7 +7887,6 @@ ${value}\r
|
||||
throw new Error((uploadRes == null ? void 0 : uploadRes.error_msg) || (uploadRes == null ? void 0 : uploadRes.error) || "115 服务器拒绝接收回调");
|
||||
}
|
||||
}
|
||||
|
||||
__publicField(JavPackSubtitle, "BTN_ID", "x-subtitle-search-btn");
|
||||
__publicField(JavPackSubtitle, "MODAL_ID", "x-subtitle-modal");
|
||||
__publicField(JavPackSubtitle, "previewCache", /* @__PURE__ */ new Map());
|
||||
@@ -7950,7 +7899,6 @@ ${value}\r
|
||||
["zh-TW", "繁中"]
|
||||
]));
|
||||
window.JavPackSubtitle = JavPackSubtitle;
|
||||
|
||||
class Req {
|
||||
static _serializeToFormData(formData, data, parentKey = "") {
|
||||
Object.entries(data).forEach(([key, val]) => {
|
||||
@@ -7963,7 +7911,6 @@ ${value}\r
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static request(config) {
|
||||
let options;
|
||||
if (typeof config === "string") {
|
||||
@@ -8021,7 +7968,6 @@ ${value}\r
|
||||
signal == null ? void 0 : signal.addEventListener("abort", handleAbort, {once: true});
|
||||
});
|
||||
}
|
||||
|
||||
static async tasks(initial, steps, signal) {
|
||||
let ctx = initial;
|
||||
for (const step of steps) {
|
||||
@@ -8035,14 +7981,12 @@ ${value}\r
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
||||
__publicField(Req, "DEFAULT_GET_RESPONSE_TYPE", "document");
|
||||
__publicField(Req, "DEFAULT_POST_RESPONSE_TYPE", "json");
|
||||
__publicField(Req, "DEFAULT_TIMEOUT", 3e4);
|
||||
__publicField(Req, "DEFAULT_METHOD", "GET");
|
||||
__publicField(Req, "_isRawBody", (v) => v instanceof FormData || v instanceof Blob || v instanceof ArrayBuffer || v instanceof URLSearchParams);
|
||||
__publicField(Req, "_isPlainObject", (v) => Object.prototype.toString.call(v) === "[object Object]");
|
||||
|
||||
class Drive115 extends Req {
|
||||
static files(cid = "0", params = {}) {
|
||||
return this.request({
|
||||
@@ -8050,28 +7994,24 @@ ${value}\r
|
||||
params: {cid, ...params}
|
||||
});
|
||||
}
|
||||
|
||||
static filesSearch(search_value, params = {}) {
|
||||
return this.request({
|
||||
url: "https://webapi.115.com/files/search",
|
||||
params: {search_value, ...params}
|
||||
});
|
||||
}
|
||||
|
||||
static lixianTaskLists(page = 1) {
|
||||
return this.request({
|
||||
url: "https://115.com/web/lixian/",
|
||||
params: {ct: "lixian", ac: "task_lists", page}
|
||||
});
|
||||
}
|
||||
|
||||
static labelList() {
|
||||
return this.request({
|
||||
url: "https://webapi.115.com/label/list",
|
||||
params: {keyword: "", limit: 11150}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @connect 115vod.com
|
||||
*/
|
||||
@@ -8081,18 +8021,15 @@ ${value}\r
|
||||
params: {pickcode, local: 1}
|
||||
});
|
||||
}
|
||||
|
||||
static post(details) {
|
||||
return this.request({method: "POST", ...details});
|
||||
}
|
||||
|
||||
static filesAdd(cname, pid) {
|
||||
return this.post({
|
||||
url: "https://webapi.115.com/files/add",
|
||||
data: {cname, pid}
|
||||
});
|
||||
}
|
||||
|
||||
static lixianAddTaskUrl(url, wp_path_id) {
|
||||
return this.post({
|
||||
url: "https://115.com/web/lixian/",
|
||||
@@ -8100,7 +8037,6 @@ ${value}\r
|
||||
data: {url, wp_path_id}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk delete offline tasks and source files
|
||||
* @param {string[]} hash Array of info_hashes
|
||||
@@ -8112,7 +8048,6 @@ ${value}\r
|
||||
data: {hash}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk delete files
|
||||
* @param {string[]} fid Array of file IDs
|
||||
@@ -8124,7 +8059,6 @@ ${value}\r
|
||||
data: {fid, pid, ignore_warn: 1}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch move files
|
||||
* @param {string[]} fid Array of file IDs
|
||||
@@ -8136,7 +8070,6 @@ ${value}\r
|
||||
data: {fid, pid, move_proid: ""}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk label files
|
||||
* @param {string} file_ids fid1,fid2,fid3...
|
||||
@@ -8148,7 +8081,6 @@ ${value}\r
|
||||
data: {file_ids, file_label, action}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk rename files
|
||||
* @param {object} files_new_name { [fid]: rename }
|
||||
@@ -8166,7 +8098,6 @@ ${value}\r
|
||||
data: {filename, filesize, target: `U_1_${cid}`}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @connect aliyuncs.com
|
||||
*/
|
||||
@@ -8194,7 +8125,6 @@ ${value}\r
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static filesEdit(fid, fid_cover) {
|
||||
return this.post({
|
||||
url: "https://webapi.115.com/files/edit",
|
||||
@@ -8202,38 +8132,30 @@ ${value}\r
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
__publicField(Drive115, "DEFAULT_GET_RESPONSE_TYPE", "json");
|
||||
|
||||
class Req115 extends Drive115 {
|
||||
static async filesAll(cid, params = {}) {
|
||||
const res = await this.files(cid, params);
|
||||
const {count, page_size, data} = res;
|
||||
return count > page_size && data.length ? this.files(cid, {...params, limit: count}) : res;
|
||||
}
|
||||
|
||||
static filesAllVideos(cid, params = {}) {
|
||||
return this.filesAll(cid, {...params, type: 4});
|
||||
}
|
||||
|
||||
static filesAllSRTs(cid, params = {}) {
|
||||
return this.filesAll(cid, {...params, suffix: "srt"});
|
||||
}
|
||||
|
||||
static async filesSearchAll(search_value, params = {}) {
|
||||
const res = await this.filesSearch(search_value, params);
|
||||
const {count, page_size, data} = res;
|
||||
return count > page_size && data.length ? this.filesSearch(search_value, {...params, limit: count}) : res;
|
||||
}
|
||||
|
||||
static filesSearchAllVideos(search_value, params = {}) {
|
||||
return this.filesSearchAll(search_value, {...params, type: 4});
|
||||
}
|
||||
|
||||
static filesSearchAllFolders(search_value, params = {}) {
|
||||
return this.filesSearchAll(search_value, {...params, fc: 1});
|
||||
}
|
||||
|
||||
static async handleDir(routes) {
|
||||
var _a;
|
||||
if (routes.length === 1 && /^\d{5,}$/.test(routes[0])) return routes[0];
|
||||
@@ -8303,7 +8225,6 @@ ${value}\r
|
||||
}
|
||||
return {videos: videos.filter(filter), file_id};
|
||||
}
|
||||
|
||||
static async handleClean(keepFiles, cid) {
|
||||
const needMove = keepFiles.filter((file) => file.cid !== cid).map((file) => file.fid);
|
||||
if (needMove.length) await this.filesMove(needMove, cid);
|
||||
@@ -8311,7 +8232,6 @@ ${value}\r
|
||||
const needRemove = data.filter((item) => !keepFiles.some((file) => file.fid === item.fid)).map((item) => item.fid ?? item.cid);
|
||||
if (needRemove.length) return this.rbDelete(needRemove, cid);
|
||||
}
|
||||
|
||||
static async handleTags(files, tags) {
|
||||
var _a;
|
||||
const {data} = await this.labelList();
|
||||
@@ -8354,7 +8274,6 @@ ${value}\r
|
||||
}
|
||||
return this.filesBatchRename(renameObj);
|
||||
}
|
||||
|
||||
static async handleCover(url, cid, filename) {
|
||||
const file = await this.request({url, timeout: 6e4, responseType: "blob"});
|
||||
if (!file) return;
|
||||
@@ -8415,12 +8334,10 @@ ${value}\r
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static async queueMutation(name2, fn) {
|
||||
return fn();
|
||||
}
|
||||
}
|
||||
|
||||
window.Req115 = Req115;
|
||||
class Fc2Plugin extends BasePlugin {
|
||||
getName() {
|
||||
@@ -8664,7 +8581,6 @@ ${value}\r
|
||||
getName() {
|
||||
return "HighlightMagnetPlugin";
|
||||
}
|
||||
|
||||
parseDateFromAttr(dateStr) {
|
||||
if (!dateStr) return 0;
|
||||
if (dateStr.length === 8) {
|
||||
@@ -8677,7 +8593,6 @@ ${value}\r
|
||||
const d = new Date(dateStr);
|
||||
return isNaN(d.getTime()) ? 0 : d.getTime();
|
||||
}
|
||||
|
||||
parseSizeToBytes(sizeText) {
|
||||
if (!sizeText) return 0;
|
||||
const s = sizeText.trim().toUpperCase();
|
||||
@@ -8689,7 +8604,6 @@ ${value}\r
|
||||
if (s.includes("KB")) return num * 1024;
|
||||
return num;
|
||||
}
|
||||
|
||||
getRowInfo(row) {
|
||||
const $row = $(row);
|
||||
const nameText = $row.find(".name").text().toLowerCase();
|
||||
@@ -8713,7 +8627,6 @@ ${value}\r
|
||||
isUncensored: nameText.includes("无码") || nameText.includes("無碼") || nameText.includes("-u") || nameText.includes("-uc") || tags.includes("无码") || tags.includes("無碼")
|
||||
};
|
||||
}
|
||||
|
||||
getRowInfoForBus(row) {
|
||||
const $row = $(row);
|
||||
const $nameCell = $row.find("td:first-child");
|
||||
@@ -8736,7 +8649,6 @@ ${value}\r
|
||||
isUncensored: nameText.includes("无码") || nameText.includes("無碼") || nameText.includes("-u") || nameText.includes("-uc")
|
||||
};
|
||||
}
|
||||
|
||||
async applySortAndFilter(settings) {
|
||||
if (isJavBus$1) {
|
||||
return this.applySortAndFilterForBus(settings);
|
||||
@@ -8798,7 +8710,6 @@ ${value}\r
|
||||
});
|
||||
hiddenInfos.forEach((info) => $(info.row).hide());
|
||||
}
|
||||
|
||||
applySortAndFilterForBus(settings) {
|
||||
const $table = $("#magnet-table");
|
||||
if (!$table.length) return;
|
||||
@@ -8853,7 +8764,6 @@ ${value}\r
|
||||
});
|
||||
hiddenInfos.forEach((info) => $(info.row).hide());
|
||||
}
|
||||
|
||||
showAll() {
|
||||
if (isJavDb$1) {
|
||||
$("#magnets-content .item[data-rank]").toArray().forEach(((el) => {
|
||||
@@ -9770,7 +9680,6 @@ ${err.stack}` : "");
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
const HLS_SCRIPT_URL = "https://cdn.jsdelivr.net/npm/hls.js@1.5.18/dist/hls.min.js";
|
||||
let hlsLoadPromise = null;
|
||||
const getHlsClass = () => {
|
||||
@@ -9841,7 +9750,6 @@ ${err.stack}` : "");
|
||||
this.loader = null;
|
||||
this.stats = this.createStats();
|
||||
}
|
||||
|
||||
createStats() {
|
||||
return {
|
||||
aborted: false,
|
||||
@@ -9858,11 +9766,9 @@ ${err.stack}` : "");
|
||||
buffering: {start: 0, first: 0, end: 0}
|
||||
};
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.abort();
|
||||
}
|
||||
|
||||
abort() {
|
||||
if (this.stats) this.stats.aborted = true;
|
||||
if (this.loader) {
|
||||
@@ -9873,7 +9779,6 @@ ${err.stack}` : "");
|
||||
}
|
||||
this.loader = null;
|
||||
}
|
||||
|
||||
load(context, config, callbacks) {
|
||||
this.context = context;
|
||||
this.callbacks = callbacks;
|
||||
@@ -9938,7 +9843,6 @@ ${err.stack}` : "");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return GMHlsLoader;
|
||||
};
|
||||
const isM3U8Url = (url) => /\.m3u8(?:[?#].*)?$/i.test(String(url || ""));
|
||||
@@ -10173,12 +10077,10 @@ ${err.stack}` : "");
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
class JavxyPreviewVideoPlugin extends BasePlugin {
|
||||
getName() {
|
||||
return "JavxyPreviewVideoPlugin";
|
||||
}
|
||||
|
||||
_attachVideoSrc(videoEl, src) {
|
||||
if (!videoEl || !src) return;
|
||||
destroyHls(videoEl);
|
||||
@@ -10209,7 +10111,6 @@ ${err.stack}` : "");
|
||||
videoEl.load && videoEl.load();
|
||||
}
|
||||
}
|
||||
|
||||
_selectDefaultQuality(qualityList, intendedDefault) {
|
||||
if (!qualityList || qualityList.length === 0) return null;
|
||||
const availableSet = new Set(qualityList);
|
||||
@@ -10218,7 +10119,6 @@ ${err.stack}` : "");
|
||||
for (const q of priorityOrder) if (availableSet.has(q)) return q;
|
||||
return qualityList[0];
|
||||
}
|
||||
|
||||
async initCss() {
|
||||
return `
|
||||
.jhs-javxy-video-modal {
|
||||
@@ -10257,14 +10157,12 @@ ${err.stack}` : "");
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
async handle() {
|
||||
if (!window.isDetailPage) return;
|
||||
const carNum2 = this.getPageInfo().carNum;
|
||||
if (!carNum2) return;
|
||||
this._addJavxyButton(carNum2);
|
||||
}
|
||||
|
||||
_addJavxyButton(carNum2) {
|
||||
let $target = null;
|
||||
if (isJavDb$1) {
|
||||
@@ -10300,7 +10198,6 @@ ${err.stack}` : "");
|
||||
});
|
||||
$target.after($btn);
|
||||
}
|
||||
|
||||
async _openJavxyPlayer(carNum2) {
|
||||
if ($("#jhs-javxy-video-modal").length === 0) {
|
||||
$("body").append(`
|
||||
@@ -11007,7 +10904,6 @@ ${err.stack}` : "");
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
const Thumbnail = {
|
||||
sources: ["javfree", "projectjav", "javstore"],
|
||||
cacheKey(code) {
|
||||
@@ -11205,7 +11101,6 @@ ${err.stack}` : "");
|
||||
}
|
||||
};
|
||||
let previewOverlay = null;
|
||||
|
||||
function showPreviewOverlay$1(imgUrl, code, source = null) {
|
||||
if (previewOverlay) {
|
||||
previewOverlay.close();
|
||||
@@ -11336,16 +11231,13 @@ ${err.stack}` : "");
|
||||
document.body.appendChild(toolbar);
|
||||
previewOverlay = {container, toolbar, close: closeOverlay};
|
||||
}
|
||||
|
||||
class ScreenShotPlugin extends BasePlugin {
|
||||
getName() {
|
||||
return "ScreenShotPlugin";
|
||||
}
|
||||
|
||||
async handle() {
|
||||
this.loadScreenShot().then();
|
||||
}
|
||||
|
||||
async loadScreenShot() {
|
||||
if (!window.isDetailPage) return;
|
||||
if ("yes" !== await storageManager.getSetting("enableLoadScreenShot", "yes")) return;
|
||||
@@ -11368,21 +11260,17 @@ ${err.stack}` : "");
|
||||
this.showErrorFallback(carNum2, e);
|
||||
}
|
||||
}
|
||||
|
||||
async getScreenshot(carNum2) {
|
||||
const result = await Thumbnail.get(carNum2);
|
||||
if (result.url) return result.url;
|
||||
throw new Error("未找到预览图");
|
||||
}
|
||||
|
||||
async getJavStoreScreenShot(carNum2) {
|
||||
return await Thumbnail.javstore(carNum2);
|
||||
}
|
||||
|
||||
async getJavFreeScreenShot(carNum2) {
|
||||
return await Thumbnail.javfree(carNum2);
|
||||
}
|
||||
|
||||
addImg(title, imgUrl, code, source) {
|
||||
if (!imgUrl) return;
|
||||
isJavDb$1 && $(".screen-container").html(
|
||||
@@ -11397,7 +11285,6 @@ ${err.stack}` : "");
|
||||
showPreviewOverlay$1(imgUrl, code || title, source);
|
||||
});
|
||||
}
|
||||
|
||||
showErrorFallback(carNum2, error) {
|
||||
var _a, _b;
|
||||
console.error("获取缩略图失败:", ((_b = (_a = error == null ? void 0 : error.message) == null ? void 0 : _a.substring) == null ? void 0 : _b.call(_a, 0, 100)) || error);
|
||||
@@ -11427,7 +11314,6 @@ ${err.stack}` : "");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.showPreviewOverlay = showPreviewOverlay$1;
|
||||
const getDownPathList = async () => {
|
||||
const res = await gmHttp.get("https://webapi.115.com/offine/downpath");
|
||||
@@ -12097,14 +11983,12 @@ ${err.stack}` : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async updateMarkBtnStyle($markBtn, carNum2) {
|
||||
const markedList = await storageManager.forage.getItem("markedDeleteList") || [];
|
||||
const isMarked = markedList.some((item) => item.carNum === carNum2);
|
||||
isMarked ? $markBtn.addClass("marked") : $markBtn.removeClass("marked");
|
||||
$markBtn.attr("title", isMarked ? "取消标记删除" : "标记删除");
|
||||
}
|
||||
|
||||
async batchDeleteMarked(selectedItems, onProgress) {
|
||||
let deletedCount = 0;
|
||||
let failedCount = 0;
|
||||
@@ -12166,7 +12050,6 @@ ${err.stack}` : "");
|
||||
}
|
||||
return {deletedCount, failedCount};
|
||||
}
|
||||
|
||||
isRateLimited(response) {
|
||||
if (!response) return false;
|
||||
if (response.state === false) {
|
||||
@@ -12180,7 +12063,6 @@ ${err.stack}` : "");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async _deleteOne(deleteId, isFile, batchIndex, selectedItems, item, onProgress) {
|
||||
let retryCount = 0;
|
||||
const maxRetries = 3;
|
||||
@@ -12763,7 +12645,6 @@ ${err.stack}` : "");
|
||||
$container.empty().append(items);
|
||||
}
|
||||
}
|
||||
|
||||
async initOneTimeSortBtn() {
|
||||
const autoPage = await storageManager.getSetting("autoPage");
|
||||
if (autoPage !== YES) {
|
||||
@@ -12779,7 +12660,6 @@ ${err.stack}` : "");
|
||||
}[oneTimeMethod];
|
||||
$("#one-time-sort-btn").text(`一次性排序: ${methodText}`).show();
|
||||
}
|
||||
|
||||
async oneTimeSortItems() {
|
||||
if (currentHref$1.includes("handle") || currentHref$1.includes("advanced_search")) return;
|
||||
if (isSearchPage) return;
|
||||
@@ -12968,70 +12848,66 @@ ${err.stack}` : "");
|
||||
__publicField2(this, "warnBackgroundColor", "#d7a80c");
|
||||
__publicField2(this, "domainErrorBackgroundColor", "#d7780c");
|
||||
__publicField2(this, "asyncQueue", new AsyncQueue());
|
||||
__publicField2(this, "siteConfigs", [{
|
||||
id: "javTrailersBtn",
|
||||
getBaseUrl: async () => await this.getJavTrailersUrl(),
|
||||
itemSelector: ".videos-list .video-link",
|
||||
__publicField2(this, "siteConfigs", [
|
||||
{
|
||||
id: "MissAvBtn",
|
||||
getBaseUrl: async () => await this.getMissAvUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.find("p.card-text").text()
|
||||
}, {
|
||||
findCarNumOrTitle: ($box2) => $box2.text()
|
||||
},
|
||||
{
|
||||
id: "123AvBtn",
|
||||
getBaseUrl: async () => await this.getAv123Url() + "/ja",
|
||||
itemSelector: ".box-item",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search?keyword=${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.find(".detail a").attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.find("img").attr("title")
|
||||
}, {
|
||||
id: "jableBtn",
|
||||
},
|
||||
{
|
||||
id: "JableBtn",
|
||||
getBaseUrl: async () => await this.getjableUrl(),
|
||||
itemSelector: "#list_videos_videos_list_search_result .detail .title a",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}/`,
|
||||
getDetailPageHref: ($box2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.text()
|
||||
}, {
|
||||
id: "avgleBtn",
|
||||
getBaseUrl: async () => await this.getAvgleUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/vod/search.html?wd=${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.text()
|
||||
}, {
|
||||
id: "missAvBtn",
|
||||
getBaseUrl: async () => await this.getMissAvUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.text()
|
||||
}, {
|
||||
id: "supJavBtn",
|
||||
},
|
||||
{
|
||||
id: "SupJavBtn",
|
||||
getBaseUrl: async () => await this.getSupJavUrl(),
|
||||
itemSelector: ".posts post",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/?s=${carNum2}`,
|
||||
getDetailPageHref: ($box2, baseUrl, carNum2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.attr("title")
|
||||
}, {
|
||||
id: "javDbBtn",
|
||||
},
|
||||
{
|
||||
id: "JavTrailersBtn",
|
||||
getBaseUrl: async () => await this.getJavTrailersUrl(),
|
||||
itemSelector: ".videos-list .video-link",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.find("p.card-text").text()
|
||||
},
|
||||
{
|
||||
id: "JavDbBtn",
|
||||
getBaseUrl: async () => await this.getJavDbUrl(),
|
||||
itemSelector: ".movie-list .item",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search?q=${carNum2}`,
|
||||
getDetailPageHref: ($box2) => $box2.find("a").attr("href"),
|
||||
findCarNumOrTitle: ($box2) => $box2.find(".video-title").text(),
|
||||
condition: (sourceCarNum) => isJavBus$1
|
||||
}, {
|
||||
id: "javBusBtn",
|
||||
},
|
||||
{
|
||||
id: "JavBusBtn",
|
||||
getBaseUrl: async () => await this.getJavBusUrl(),
|
||||
itemSelector: ".container h3",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/${carNum2}`,
|
||||
getDetailPageHref: ($box2, baseUrl, carNum2) => `${baseUrl}/${carNum2}`,
|
||||
findCarNumOrTitle: ($box2) => $box2.text(),
|
||||
condition: (sourceCarNum) => isJavDb$1 && sourceCarNum && !sourceCarNum.includes("FC2")
|
||||
}, {
|
||||
id: "fanzaBtn",
|
||||
noHandle: true,
|
||||
initUrl: (carNum2) => `https://www.dmm.co.jp/search/=/searchstr=${carNum2}`,
|
||||
condition: (sourceCarNum) => sourceCarNum && !sourceCarNum.includes("FC2")
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
__publicField2(this, "settingCache", null);
|
||||
__publicField2(this, "lastFetchTime", 0);
|
||||
__publicField2(this, "CACHE_DURATION", 1e4);
|
||||
@@ -13056,7 +12932,7 @@ ${err.stack}` : "");
|
||||
if (config.condition && false === config.condition(config.sourceCarNum)) return "";
|
||||
return `<a target="_blank" class="site-btn" style="${enabledSites.includes(config.id) ? "" : "display:none"}" id="${config.id}"><span>${config.id.replace("Btn", "")}</span></a>`;
|
||||
})).join("")}
|
||||
<a id="settingSiteBtn" class="site-btn"><span>设置</span></a>
|
||||
<a id="settingSiteBtn" class="site-btn"><span>跳转设置</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13083,23 +12959,7 @@ ${err.stack}` : "");
|
||||
}
|
||||
async handleSite(carNum2, config) {
|
||||
const $btn = $(`#${config.id}`);
|
||||
if (config.initUrl) {
|
||||
$btn.attr("href", config.initUrl(carNum2));
|
||||
$btn.css("backgroundColor", this.warnBackgroundColor);
|
||||
}
|
||||
if (config.noHandle && true === config.noHandle) {
|
||||
const dmmCacheKey = "jhs_other_site_dmm", dmmCachedResult = (localStorage.getItem(dmmCacheKey) ? JSON.parse(localStorage.getItem(dmmCacheKey)) : {})[carNum2];
|
||||
if (dmmCachedResult) {
|
||||
if ("single" === dmmCachedResult.type) {
|
||||
$btn.attr("href", dmmCachedResult.url);
|
||||
$btn.css("backgroundColor", this.okBackgroundColor);
|
||||
} else if ("multiple" === dmmCachedResult.type) {
|
||||
$btn.attr("href", dmmCachedResult.url);
|
||||
$btn.append('<span class="site-tag" style="top:-15px">多结果</span>');
|
||||
$btn.css("backgroundColor", this.okBackgroundColor);
|
||||
}
|
||||
}
|
||||
} else try {
|
||||
try {
|
||||
if ($btn.attr("href")) return;
|
||||
if (utils.isHidden($btn)) return;
|
||||
const cacheKey = "jhs_other_site", cacheData = localStorage.getItem(cacheKey) ? JSON.parse(localStorage.getItem(cacheKey)) : {}, siteKey = carNum2 + "_" + config.id.replace("Btn", ""), cachedResult = cacheData[siteKey];
|
||||
@@ -13188,9 +13048,6 @@ ${err.stack}` : "");
|
||||
async getjableUrl() {
|
||||
return (await this.getSettingCache()).jableUrl || "https://jable.tv";
|
||||
}
|
||||
async getAvgleUrl() {
|
||||
return (await this.getSettingCache()).avgleUrl || "https://jav.rs";
|
||||
}
|
||||
async getJavTrailersUrl() {
|
||||
return (await this.getSettingCache()).javTrailersUrl || "https://javtrailers.com";
|
||||
}
|
||||
@@ -13592,9 +13449,6 @@ ${err.stack}` : "");
|
||||
<a class="site-btn site-jable" style="color:white !important;margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;">Jable</span>
|
||||
</a>
|
||||
<a class="site-btn site-avgle" style="margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;">Avgle</span>
|
||||
</a>
|
||||
<a class="site-btn site-miss-av" style="color:white !important;margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;">MissAv</span>
|
||||
</a>
|
||||
@@ -13656,9 +13510,6 @@ ${err.stack}` : "");
|
||||
<a class="site-btn site-jable" style="color:white;margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;display: inline; color:white !important">Jable</span>
|
||||
</a>
|
||||
<a class="site-btn site-avgle" style="margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;display: inline; color:white !important">Avgle</span>
|
||||
</a>
|
||||
<a class="site-btn site-miss-av" style="color:white;margin-bottom: 5px;background-color:#71bb59;">
|
||||
<span style="opacity: 1;display: inline; color:white !important">MissAv</span>
|
||||
</a>
|
||||
@@ -13785,13 +13636,14 @@ ${err.stack}` : "");
|
||||
$btn.hasClass("filterBtn") ? utils.q(event, `是否屏蔽${carNum2}?`, (() => handleAction(Status_FILTER$1))) : $btn.hasClass("favoriteBtn") ? handleAction(Status_FAVORITE$1).then() : $btn.hasClass("hasDownBtn") ? handleAction(Status_HAS_DOWN$1).then() : $btn.hasClass("hasWatchBtn") && handleAction(Status_HAS_WATCH$1).then();
|
||||
$(".more-tools").stop(true, true).removeClass("elastic-in").addClass("elastic-out").hide();
|
||||
}));
|
||||
const otherSitePlugin = this.getBean("OtherSitePlugin"), missAvUrl = await otherSitePlugin.getMissAvUrl(), jableUrl = await otherSitePlugin.getjableUrl(), avgleUrl = await otherSitePlugin.getAvgleUrl(), av123Url = await otherSitePlugin.getAv123Url();
|
||||
$(document).on("click", ".site-jable, .site-avgle, .site-miss-av, .site-123-av", ((event) => {
|
||||
const otherSitePlugin = this.getBean("OtherSitePlugin"), missAvUrl = await otherSitePlugin.getMissAvUrl(),
|
||||
jableUrl = await otherSitePlugin.getjableUrl(), av123Url = await otherSitePlugin.getAv123Url();
|
||||
$(document).on("click", ".site-jable, .site-miss-av, .site-123-av", ((event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const $currentTarget = $(event.currentTarget), $box2 = $currentTarget.closest(".item"), { carNum: carNum2 } = this.getBoxCarInfo($box2);
|
||||
let url = null;
|
||||
$currentTarget.hasClass("site-jable") ? url = `${jableUrl}/search/${carNum2}/` : $currentTarget.hasClass("site-avgle") ? url = `${avgleUrl}/vod/search.html?wd=${carNum2}` : $currentTarget.hasClass("site-miss-av") ? url = `${missAvUrl}/search/${carNum2}` : $currentTarget.hasClass("site-123-av") && (url = `${av123Url}/ja/search?keyword=${carNum2}`);
|
||||
$currentTarget.hasClass("site-jable") ? url = `${jableUrl}/search/${carNum2}/` : $currentTarget.hasClass("site-miss-av") ? url = `${missAvUrl}/search/${carNum2}` : $currentTarget.hasClass("site-123-av") && (url = `${av123Url}/ja/search?keyword=${carNum2}`);
|
||||
event && (event.ctrlKey || event.metaKey) ? _GM_openInTab(url, {
|
||||
insert: 0
|
||||
}) : window.open(url);
|
||||
@@ -14440,7 +14292,6 @@ ${err.stack}` : "");
|
||||
window.JavPackSubtitle.preload115Matches(carNum2);
|
||||
this.showStatus(carNum2).then();
|
||||
}
|
||||
|
||||
async openMagnetSortFilterPanel(highlightMagnetPlugin) {
|
||||
const existingPanel = document.getElementById("magnet-sort-filter-panel");
|
||||
if (existingPanel) {
|
||||
@@ -14693,7 +14544,6 @@ ${err.stack}` : "");
|
||||
window.refresh();
|
||||
utils.closePage();
|
||||
}
|
||||
|
||||
/*
|
||||
searchXunLeiSubtitle(carNum2) {
|
||||
let loadObj = loading();
|
||||
|
||||
File diff suppressed because one or more lines are too long
+58
-59
@@ -1,6 +1,6 @@
|
||||
import { BasePlugin } from '../core/base-plugin.js';
|
||||
import { __publicField, isJavBus, isJavDb } from '../core/constants.js';
|
||||
import { AsyncQueue } from '../core/utils.js';
|
||||
import {BasePlugin} from '../core/base-plugin.js';
|
||||
import {__publicField, isJavBus, isJavDb} from '../core/constants.js';
|
||||
import {AsyncQueue} from '../core/utils.js';
|
||||
|
||||
class OtherSitePlugin extends BasePlugin {
|
||||
constructor() {
|
||||
@@ -10,13 +10,14 @@ class OtherSitePlugin extends BasePlugin {
|
||||
__publicField(this, "warnBackgroundColor", "#d7a80c");
|
||||
__publicField(this, "domainErrorBackgroundColor", "#d7780c");
|
||||
__publicField(this, "asyncQueue", new AsyncQueue);
|
||||
__publicField(this, "siteConfigs", [ {
|
||||
id: "javTrailersBtn",
|
||||
getBaseUrl: async () => await this.getJavTrailersUrl(),
|
||||
itemSelector: ".videos-list .video-link",
|
||||
__publicField(this, "siteConfigs", [
|
||||
{
|
||||
id: "MissAvBtn",
|
||||
getBaseUrl: async () => await this.getMissAvUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: $box2 => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.find("p.card-text").text()
|
||||
findCarNumOrTitle: $box2 => $box2.text()
|
||||
}, {
|
||||
id: "123AvBtn",
|
||||
getBaseUrl: async () => await this.getAv123Url() + "/ja",
|
||||
@@ -25,35 +26,31 @@ class OtherSitePlugin extends BasePlugin {
|
||||
getDetailPageHref: $box2 => $box2.find(".detail a").attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.find("img").attr("title")
|
||||
}, {
|
||||
id: "jableBtn",
|
||||
id: "JableBtn",
|
||||
getBaseUrl: async () => await this.getjableUrl(),
|
||||
itemSelector: "#list_videos_videos_list_search_result .detail .title a",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}/`,
|
||||
getDetailPageHref: $box2 => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.text()
|
||||
}, {
|
||||
id: "avgleBtn",
|
||||
getBaseUrl: async () => await this.getAvgleUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/vod/search.html?wd=${carNum2}`,
|
||||
getDetailPageHref: $box2 => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.text()
|
||||
}, {
|
||||
id: "missAvBtn",
|
||||
getBaseUrl: async () => await this.getMissAvUrl(),
|
||||
itemSelector: ".text-secondary",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: $box2 => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.text()
|
||||
}, {
|
||||
id: "supJavBtn",
|
||||
id: "SupJavBtn",
|
||||
getBaseUrl: async () => await this.getSupJavUrl(),
|
||||
itemSelector: ".posts post",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/?s=${carNum2}`,
|
||||
getDetailPageHref: ($box2, baseUrl, carNum2) => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.attr("title")
|
||||
}, {
|
||||
id: "javDbBtn",
|
||||
},
|
||||
{
|
||||
id: "JavTrailersBtn",
|
||||
getBaseUrl: async () => await this.getJavTrailersUrl(),
|
||||
itemSelector: ".videos-list .video-link",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search/${carNum2}`,
|
||||
getDetailPageHref: $box2 => $box2.attr("href"),
|
||||
findCarNumOrTitle: $box2 => $box2.find("p.card-text").text()
|
||||
},
|
||||
|
||||
{
|
||||
id: "JavDbBtn",
|
||||
getBaseUrl: async () => await this.getJavDbUrl(),
|
||||
itemSelector: ".movie-list .item",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/search?q=${carNum2}`,
|
||||
@@ -61,47 +58,49 @@ class OtherSitePlugin extends BasePlugin {
|
||||
findCarNumOrTitle: $box2 => $box2.find(".video-title").text(),
|
||||
condition: sourceCarNum => isJavBus
|
||||
}, {
|
||||
id: "javBusBtn",
|
||||
id: "JavBusBtn",
|
||||
getBaseUrl: async () => await this.getJavBusUrl(),
|
||||
itemSelector: ".container h3",
|
||||
searchPath: (baseUrl, carNum2) => `${baseUrl}/${carNum2}`,
|
||||
getDetailPageHref: ($box2, baseUrl, carNum2) => `${baseUrl}/${carNum2}`,
|
||||
findCarNumOrTitle: $box2 => $box2.text(),
|
||||
condition: sourceCarNum => isJavDb && sourceCarNum && !sourceCarNum.includes("FC2")
|
||||
}, {
|
||||
id: "fanzaBtn",
|
||||
noHandle: !0,
|
||||
initUrl: carNum2 => `https://www.dmm.co.jp/search/=/searchstr=${carNum2}`,
|
||||
condition: sourceCarNum => sourceCarNum && !sourceCarNum.includes("FC2")
|
||||
} ]);
|
||||
}]);
|
||||
__publicField(this, "settingCache", null);
|
||||
__publicField(this, "lastFetchTime", 0);
|
||||
__publicField(this, "CACHE_DURATION", 1e4);
|
||||
}
|
||||
|
||||
getName() {
|
||||
return "OtherSitePlugin";
|
||||
}
|
||||
|
||||
async initCss() {
|
||||
return "\n <style>\n .site-btn {\n position: relative !important;\n min-width: 80px;\n display: inline-block;\n padding: 5px 10px;\n color: white !important;\n background-color:#938585;\n text-decoration: none;\n border-radius: 4px;\n text-align: center;\n margin-bottom: 5px;\n }\n .site-btn:hover {\n color: white;\n transform: translateY(-2px);\n box-shadow: 0 2px 5px rgba(0,0,0,0.1);\n }\n .site-tag {\n position: absolute; \n top: -15px; \n right: 0; \n background-color: #ffc107; \n color: #333; \n font-size: 12px; \n padding: 2px 6px; \n border-radius: 4px;\n }\n </style>\n ";
|
||||
}
|
||||
|
||||
async handle() {
|
||||
window.isDetailPage && this.loadOtherSite().then();
|
||||
}
|
||||
|
||||
async loadOtherSite(carNum2, sourceCarNum) {
|
||||
if ("yes" !== await storageManager.getSetting("enableLoadOtherSite", "yes")) return;
|
||||
carNum2 || (carNum2 = this.getPageInfo().carNum);
|
||||
const enabledSites = this.getEnabledSites(), html = `\n <div id="otherSiteBox" class="panel-block" style="${isJavDb ? "margin-top:8px;font-size:13px" : "margin-top:10px;font-size:13px"}; user-select: none; ">\n <div style="display: flex;gap: 5px;flex-wrap: wrap">\n ${this.siteConfigs.map((config => {
|
||||
const enabledSites = this.getEnabledSites(),
|
||||
html = `\n <div id="otherSiteBox" class="panel-block" style="${isJavDb ? "margin-top:8px;font-size:13px" : "margin-top:10px;font-size:13px"}; user-select: none; ">\n <div style="display: flex;gap: 5px;flex-wrap: wrap">\n ${this.siteConfigs.map((config => {
|
||||
config.sourceCarNum = sourceCarNum;
|
||||
if (config.condition && !1 === config.condition(config.sourceCarNum)) return "";
|
||||
return `<a target="_blank" class="site-btn" style="${enabledSites.includes(config.id) ? "" : "display:none"}" id="${config.id}"><span>${config.id.replace("Btn", "")}</span></a>`;
|
||||
})).join("")}\n <a id="settingSiteBtn" class="site-btn"><span>设置</span></a>\n </div>\n </div>\n \n <div id="settingsArea" class="panel-block" style="display: none; margin-top:10px; margin-bottom: 10px; user-select: none; ">\n <div id="siteCheckboxes" style="display: flex;gap: 5px;flex-wrap: wrap">\n </div>\n </div>\n `;
|
||||
})).join("")}\n <a id="settingSiteBtn" class="site-btn"><span>跳转设置</span></a>\n </div>\n </div>\n \n <div id="settingsArea" class="panel-block" style="display: none; margin-top:10px; margin-bottom: 10px; user-select: none; ">\n <div id="siteCheckboxes" style="display: flex;gap: 5px;flex-wrap: wrap">\n </div>\n </div>\n `;
|
||||
$(".movie-panel-info").append(html);
|
||||
$(".container .info").append(html);
|
||||
$("#javTrailersBtn").on("click", (async event => {
|
||||
event.preventDefault();
|
||||
let settingObj = await storageManager.getSetting();
|
||||
const filterHotKey = settingObj.filterHotKey, favoriteHotKey = settingObj.favoriteHotKey, speedVideoHotKey = settingObj.speedVideoHotKey;
|
||||
let href = $("#javTrailersBtn").attr("href"), url = href + `?handle=1&filterHotKey=${filterHotKey}&favoriteHotKey=${favoriteHotKey}&speedVideoHotKey=${speedVideoHotKey}`;
|
||||
const filterHotKey = settingObj.filterHotKey, favoriteHotKey = settingObj.favoriteHotKey,
|
||||
speedVideoHotKey = settingObj.speedVideoHotKey;
|
||||
let href = $("#javTrailersBtn").attr("href"),
|
||||
url = href + `?handle=1&filterHotKey=${filterHotKey}&favoriteHotKey=${favoriteHotKey}&speedVideoHotKey=${speedVideoHotKey}`;
|
||||
event && (event.ctrlKey || event.metaKey) && (url = href);
|
||||
utils.openPage(url, carNum2, !1, event);
|
||||
}));
|
||||
@@ -111,26 +110,15 @@ class OtherSitePlugin extends BasePlugin {
|
||||
this.renderSettingsArea();
|
||||
this.setupEventListeners();
|
||||
}
|
||||
|
||||
async handleSite(carNum2, config) {
|
||||
const $btn = $(`#${config.id}`);
|
||||
if (config.initUrl) {
|
||||
$btn.attr("href", config.initUrl(carNum2));
|
||||
$btn.css("backgroundColor", this.warnBackgroundColor);
|
||||
}
|
||||
if (config.noHandle && !0 === config.noHandle) {
|
||||
const dmmCacheKey = "jhs_other_site_dmm", dmmCachedResult = (localStorage.getItem(dmmCacheKey) ? JSON.parse(localStorage.getItem(dmmCacheKey)) : {})[carNum2];
|
||||
if (dmmCachedResult) if ("single" === dmmCachedResult.type) {
|
||||
$btn.attr("href", dmmCachedResult.url);
|
||||
$btn.css("backgroundColor", this.okBackgroundColor);
|
||||
} else if ("multiple" === dmmCachedResult.type) {
|
||||
$btn.attr("href", dmmCachedResult.url);
|
||||
$btn.append('<span class="site-tag" style="top:-15px">多结果</span>');
|
||||
$btn.css("backgroundColor", this.okBackgroundColor);
|
||||
}
|
||||
} else try {
|
||||
try {
|
||||
if ($btn.attr("href")) return;
|
||||
if (utils.isHidden($btn)) return;
|
||||
const cacheKey = "jhs_other_site", cacheData = localStorage.getItem(cacheKey) ? JSON.parse(localStorage.getItem(cacheKey)) : {}, siteKey = carNum2 + "_" + config.id.replace("Btn", ""), cachedResult = cacheData[siteKey];
|
||||
const cacheKey = "jhs_other_site",
|
||||
cacheData = localStorage.getItem(cacheKey) ? JSON.parse(localStorage.getItem(cacheKey)) : {},
|
||||
siteKey = carNum2 + "_" + config.id.replace("Btn", ""), cachedResult = cacheData[siteKey];
|
||||
if (cachedResult) {
|
||||
if ("single" === cachedResult.type) {
|
||||
$btn.attr("href", cachedResult.url);
|
||||
@@ -144,7 +132,8 @@ class OtherSitePlugin extends BasePlugin {
|
||||
}
|
||||
const baseUrl = await config.getBaseUrl(), searchUrl = config.searchPath(baseUrl, carNum2);
|
||||
$btn.attr("href", searchUrl);
|
||||
const html = await gmHttp.get(searchUrl, null, config.headers, !0), $dom = utils.htmlTo$dom(html), resultUrlList = [];
|
||||
const html = await gmHttp.get(searchUrl, null, config.headers, !0), $dom = utils.htmlTo$dom(html),
|
||||
resultUrlList = [];
|
||||
$dom.find(config.itemSelector).each(((index, element) => {
|
||||
const $box2 = $(element);
|
||||
if (!config.findCarNumOrTitle($box2).toLowerCase().includes(carNum2.toLowerCase())) return;
|
||||
@@ -202,6 +191,7 @@ class OtherSitePlugin extends BasePlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getSettingCache() {
|
||||
const now = Date.now();
|
||||
if (!this.settingCache || now - this.lastFetchTime > this.CACHE_DURATION) {
|
||||
@@ -210,37 +200,44 @@ class OtherSitePlugin extends BasePlugin {
|
||||
}
|
||||
return this.settingCache;
|
||||
}
|
||||
|
||||
async getMissAvUrl() {
|
||||
return (await this.getSettingCache()).missAvUrl || "https://missav.live";
|
||||
}
|
||||
|
||||
async getjableUrl() {
|
||||
return (await this.getSettingCache()).jableUrl || "https://jable.tv";
|
||||
}
|
||||
async getAvgleUrl() {
|
||||
return (await this.getSettingCache()).avgleUrl || "https://jav.rs";
|
||||
}
|
||||
|
||||
async getJavTrailersUrl() {
|
||||
return (await this.getSettingCache()).javTrailersUrl || "https://javtrailers.com";
|
||||
}
|
||||
|
||||
async getAv123Url() {
|
||||
return (await this.getSettingCache()).av123Url || "https://123av.com";
|
||||
}
|
||||
|
||||
async getJavDbUrl() {
|
||||
return (await this.getSettingCache()).javDbUrl || "https://javdb.com";
|
||||
}
|
||||
|
||||
async getJavBusUrl() {
|
||||
return (await this.getSettingCache()).javBusUrl || "https://www.javbus.com";
|
||||
}
|
||||
|
||||
async getSupJavUrl() {
|
||||
return (await this.getSettingCache()).supJavUrl || "https://supjav.com";
|
||||
}
|
||||
|
||||
getEnabledSites() {
|
||||
const enabledSites = localStorage.getItem("jhs_enabled_sites");
|
||||
return enabledSites ? JSON.parse(enabledSites) : this.siteConfigs.map((c => c.id));
|
||||
}
|
||||
|
||||
saveEnabledSites(sites) {
|
||||
localStorage.setItem("jhs_enabled_sites", JSON.stringify(sites));
|
||||
}
|
||||
|
||||
renderSettingsArea() {
|
||||
const enabledSites = this.getEnabledSites(), checkboxesDiv = document.getElementById("siteCheckboxes");
|
||||
checkboxesDiv && (checkboxesDiv.innerHTML = this.siteConfigs.map((config => {
|
||||
@@ -248,6 +245,7 @@ class OtherSitePlugin extends BasePlugin {
|
||||
return `\n <div style="margin-right: 15px; display: flex; align-items: ${isJavDb ? "center" : "flex-start"};">\n <input type="checkbox" id="checkbox-${config.id}" data-site-id="${config.id}" ${isEnabled ? "checked" : ""} style="margin-right: 8px; cursor: pointer;">\n <label for="checkbox-${config.id}" style="color: #333; font-weight: 500; cursor: pointer;">${config.id.replace("Btn", "")}</label>\n </div>\n `;
|
||||
})).join(""));
|
||||
}
|
||||
|
||||
setupEventListeners() {
|
||||
const settingsArea = document.getElementById("settingsArea");
|
||||
document.addEventListener("click", (event => {
|
||||
@@ -261,7 +259,8 @@ class OtherSitePlugin extends BasePlugin {
|
||||
const siteId = event.target.getAttribute("data-site-id");
|
||||
if (event.target.checked) {
|
||||
$(`#${siteId}`).show();
|
||||
const carNum2 = this.getPageInfo().carNum, config = this.siteConfigs.find((item => item.id === siteId));
|
||||
const carNum2 = this.getPageInfo().carNum,
|
||||
config = this.siteConfigs.find((item => item.id === siteId));
|
||||
this.handleSite(carNum2, config).then();
|
||||
} else $(`#${siteId}`).hide();
|
||||
const enabledSites = Array.from(settingsArea.querySelectorAll('input[type="checkbox"]:checked')).map((checkbox => checkbox.getAttribute("data-site-id")));
|
||||
@@ -272,4 +271,4 @@ class OtherSitePlugin extends BasePlugin {
|
||||
}
|
||||
|
||||
|
||||
export { OtherSitePlugin };
|
||||
export {OtherSitePlugin};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user