A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
feat(workers): allows videoWorker to use ytdlp command line arguments specified in the config. Fixes #775 #792 (#1117)
erik-nilcoastbffbd43672ca
diff --git a/apps/workers/videoWorker.ts b/apps/workers/videoWorker.tsindex 32f16f97..23ead8f8 100644--- a/apps/workers/videoWorker.ts+++ b/apps/workers/videoWorker.ts@@ -63,7 +63,6 @@ export class VideoWorker {}function prepareYtDlpArguments(url: string, assetPath: string) {- // TODO allow custom commandline arguments?const ytDlpArguments = [url];if (serverConfig.crawler.maxVideoDownloadSize > 0) {ytDlpArguments.push(@@ -71,6 +70,8 @@ function prepareYtDlpArguments(url: string, assetPath: string) {`best[filesize<${serverConfig.crawler.maxVideoDownloadSize}M]`,);}++ ytDlpArguments.push(...serverConfig.crawler.ytDlpArguments);ytDlpArguments.push("-o", assetPath);ytDlpArguments.push("--no-playlist");return ytDlpArguments;diff --git a/docs/docs/03-configuration.md b/docs/docs/03-configuration.mdindex 27f9f14e..36de8295 100644--- a/docs/docs/03-configuration.md+++ b/docs/docs/03-configuration.md@@ -87,6 +87,7 @@ Either `OPENAI_API_KEY` or `OLLAMA_BASE_URL` need to be set for automatic taggin| CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE | No | 50 | The maximum file size for the downloaded video. The quality will be chosen accordingly. Use -1 to disable the limit. || CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC | No | 600 | How long to wait for the video download to finish || CRAWLER_ENABLE_ADBLOCKER | No | true | Whether to enable an adblocker in the crawler or not. If you're facing troubles downloading the adblocking lists on worker startup, you can disable this. |+| CRAWLER_YTDLP_ARGS | No | [] | Include additional yt-dlp arguments to be passed at crawl time separated by %%: https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#general-options## OCR Configsdiff --git a/packages/shared/config.ts b/packages/shared/config.tsindex 1295fdbf..f487478f 100644--- a/packages/shared/config.ts+++ b/packages/shared/config.ts@@ -49,6 +49,10 @@ const allEnv = z.object({CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE: z.coerce.number().default(50),CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC: z.coerce.number().default(10 * 60),CRAWLER_ENABLE_ADBLOCKER: stringBool("true"),+ CRAWLER_YTDLP_ARGS: z+ .string()+ .default("")+ .transform((t) => t.split("%%").filter((a) => a)),MEILI_ADDR: z.string().optional(),MEILI_MASTER_KEY: z.string().default(""),LOG_LEVEL: z.string().default("debug"),@@ -116,6 +120,7 @@ const serverConfigSchema = allEnv.transform((val) => {maxVideoDownloadSize: val.CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE,downloadVideoTimeout: val.CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC,enableAdblocker: val.CRAWLER_ENABLE_ADBLOCKER,+ ytDlpArguments: val.CRAWLER_YTDLP_ARGS,},ocr: {langs: val.OCR_LANGS,