feat: trying to add hashes to scripts

This commit is contained in:
Max Richter
2026-01-10 13:03:13 +01:00
parent e65938ecc2
commit e55f787a29
79 changed files with 4209 additions and 720 deletions

View File

@@ -1,5 +1,3 @@
import { Handlers } from "$fresh/server.ts";
import { Defuddle } from "defuddle/node";
import { AccessDeniedError, BadRequestError } from "@lib/errors.ts";
import { createStreamResponse, isValidUrl } from "@lib/helpers.ts";
import * as openai from "@lib/openai.ts";
@@ -7,6 +5,7 @@ import * as unsplash from "@lib/unsplash.ts";
import { getYoutubeVideoDetails } from "@lib/youtube.ts";
import {
extractYoutubeId,
fileExtension,
formatDate,
isYoutubeLink,
safeFileName,
@@ -16,7 +15,7 @@ import { createLogger } from "@lib/log/index.ts";
import { createResource } from "@lib/marka/index.ts";
import { webScrape } from "@lib/webScraper.ts";
import { ArticleResource } from "@lib/marka/schema.ts";
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
import { define } from "../../../../utils.ts";
const log = createLogger("api/article");
@@ -201,8 +200,9 @@ async function processCreateYoutubeVideo(
streamResponse.send({ type: "finished", url: filename });
}
export const handler: Handlers = {
GET(req, ctx) {
export const handler = define.handlers({
GET(ctx) {
const req = ctx.req;
const session = ctx.state.session;
if (!session) {
throw new AccessDeniedError();
@@ -239,4 +239,4 @@ export const handler: Handlers = {
return streamResponse.response;
},
};
});