add [javdb] into sitelist

This commit is contained in:
mrbunker
2023-01-20 21:59:55 +08:00
parent a9dc863e97
commit 747ed2dbb7
5 changed files with 387 additions and 367 deletions

24
dist/jop.user.js vendored
View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name JAV 添加跳转在线观看
// @namespace https://greasyfork.org/zh-CN/scripts/429173
// @version 1.1.3
// @version 1.1.4
// @author mission522
// @description [高效寻找最佳的在线资源] 在影片详情页添加跳转在线播放的按钮,并注是否提供在线播放资源或无码资源、字幕资源等信息。支持 JavDB、JavBus 以及 JavLibrary
// @license MIT
@@ -28,6 +28,7 @@
// @connect ggjav.com
// @connect av01.tv
// @connect javbus.com
// @connect javdb.com
// @connect javdb007.com
// @grant GM_getValue
// @grant GM_setValue
@@ -746,6 +747,19 @@
domQuery: {},
method: print,
},
{
name: "JavDB",
disableHostname: "javdb",
disable: false,
hostname: "javdb.com",
url: "https://javdb.com/search?q={{code}}",
fetcher: "parser",
domQuery: {
linkQuery: ".movie-list>.item:first-child>a",
titleQuery: ".video-title",
},
method: print,
},
];
var monkeyWindow = window;
var GM_setValue = /* @__PURE__ */ (() => monkeyWindow.GM_setValue)();
@@ -932,7 +946,7 @@
],
});
});
const Setting = ({ sites, setSites, disable }) => {
const Setting = ({ sites, setSites, disables: disable }) => {
const [showSetting, setShowSetting] = p(false);
const newDisable = disable;
return o(preact2.Fragment, {
@@ -998,13 +1012,13 @@
});
};
const App = R(function ({ current, CODE }) {
const disable = GM_getValue("disable", ["AvJoy", "baihuse", "AV01"]);
const disables = GM_getValue("disable", ["AvJoy", "baihuse", "AV01"]);
const [sites, setSites] = p(siteList);
const sitesDisHost = sites.filter(
(item) => item.disableHostname !== current.name && !item.disable,
);
const filter = sitesDisHost.filter((item) => {
if (!disable.includes(item.name)) return item;
if (!disables.includes(item.name)) return item;
});
return o(preact2.Fragment, {
children: [
@@ -1021,7 +1035,7 @@
children: o(Setting, {
sites,
setSites,
disable,
disables,
}),
}),
],

View File

@@ -6,7 +6,7 @@ import SiteButton from "./SiteButton";
import { Setting } from "./Setting";
const App = memo(function ({ current, CODE }: { current: Current; CODE: string }) {
const disable = GM_getValue<SiteItem["name"][]>("disable", ["AvJoy", "baihuse", "AV01"]);
const disables = GM_getValue<SiteItem["name"][]>("disable", ["AvJoy", "baihuse", "AV01"]);
// sites 最原始的 siteList.json
const [sites, setSites] = useState(siteList);
@@ -18,7 +18,7 @@ const App = memo(function ({ current, CODE }: { current: Current; CODE: string }
/** 禁用 用户自定义 */
const filter = sitesDisHost.filter((item) => {
if (!disable.includes(item.name)) return item;
if (!disables.includes(item.name)) return item;
});
return (
@@ -29,7 +29,7 @@ const App = memo(function ({ current, CODE }: { current: Current; CODE: string }
))}
</div>
<div>
<Setting sites={sites} setSites={setSites} disable={disable} />
<Setting sites={sites} setSites={setSites} disables={disables} />
</div>
</>
);

View File

@@ -5,11 +5,11 @@ import { GM_setValue } from "vite-plugin-monkey/dist/client";
export const Setting = ({
sites,
setSites,
disable,
disables: disable,
}: {
sites: SiteItem[];
setSites: StateUpdater<SiteItem[]>;
disable: SiteItem["name"][];
disables: SiteItem["name"][];
}) => {
const [showSetting, setShowSetting] = useState(false);
/** 暂存用户的勾选,最后保存的时候提交 */

View File

@@ -22,7 +22,9 @@ interface SiteItemBase {
disableHostname?: string;
hostname: string;
url: string;
/** 没用 */
codeFormater?: (arg0: string) => string;
/** 没用 */
method?: Function;
}
@@ -239,13 +241,17 @@ export const siteList: SiteItem[] = [
domQuery: {},
method: print,
},
// {
// name: "JavDB",
// disable:"javdb",
// hostname: "javbus.com",
// url: "https://javbus.com/{{code}}",
// fetcher: "get",
// domQuery: {},
// method: print,
// },
{
name: "JavDB",
disableHostname: "javdb",
disable: false,
hostname: "javdb.com",
url: "https://javdb.com/search?q={{code}}",
fetcher: "parser",
domQuery: {
linkQuery: ".movie-list>.item:first-child>a",
titleQuery: ".video-title",
},
method: print,
},
];

View File

@@ -7,7 +7,7 @@ const connectList = siteList.map((site) => site.hostname).concat(["javdb007.com"
const UserscriptConfig: MonkeyUserScript = {
author: "mission522",
version: "1.1.3",
version: "1.1.4",
license: "MIT",
name: "JAV 添加跳转在线观看",
match: ["*://*/cn/?v=jav*"],