mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Add more og:xx info
Add share param for export gallery
This commit is contained in:
@@ -98,6 +98,15 @@ export async function handler(req: Request, ctx: FreshContext) {
|
||||
)?.setAttribute("content", title);
|
||||
doc.querySelector('meta[name="description"]')
|
||||
?.setAttribute("content", desc);
|
||||
const head = doc.querySelector("head");
|
||||
const ogt = dom.createElement("meta");
|
||||
ogt.setAttribute("name", "og:title");
|
||||
ogt.setAttribute("content", title);
|
||||
const ogd = dom.createElement("meta");
|
||||
ogd.setAttribute("name", "og:description");
|
||||
ogd.setAttribute("content", desc);
|
||||
head?.append(ogt);
|
||||
head?.append(ogd);
|
||||
if (m.cfg.img_verify_secret && doc) {
|
||||
const p = m.db.get_pmeta_by_index(st.info.gid, 1);
|
||||
if (p) {
|
||||
@@ -130,7 +139,14 @@ export async function handler(req: Request, ctx: FreshContext) {
|
||||
const me = dom.createElement("meta");
|
||||
me.setAttribute("name", "og:image");
|
||||
me.setAttribute("content", url);
|
||||
doc.querySelector("head")?.append(me);
|
||||
const ogty = dom.createElement("meta");
|
||||
ogty.setAttribute("name", "og:type");
|
||||
ogty.setAttribute(
|
||||
"content",
|
||||
"summary_large_image",
|
||||
);
|
||||
head?.append(me);
|
||||
head?.append(ogty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,13 @@ function handle_auth(req: Request, ctx: FreshContext) {
|
||||
token = cookies.get("token");
|
||||
is_from_cookie = true;
|
||||
}
|
||||
if (
|
||||
u.pathname.startsWith("/api/export/gallery/zip/") &&
|
||||
req.method === "GET"
|
||||
) {
|
||||
token = u.searchParams.get("share");
|
||||
is_from_cookie = false;
|
||||
}
|
||||
const check = () => {
|
||||
if (u.pathname === "/api/token" && req.method === "PUT") return true;
|
||||
if (u.pathname === "/api/status" && req.method === "GET") return true;
|
||||
|
||||
Reference in New Issue
Block a user