File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,15 @@ export class VideoWorker {
63
63
}
64
64
65
65
function prepareYtDlpArguments ( url : string , assetPath : string ) {
66
- // TODO allow custom commandline arguments?
67
66
const ytDlpArguments = [ url ] ;
68
67
if ( serverConfig . crawler . maxVideoDownloadSize > 0 ) {
69
68
ytDlpArguments . push (
70
69
"-f" ,
71
70
`best[filesize<${ serverConfig . crawler . maxVideoDownloadSize } M]` ,
72
71
) ;
73
72
}
73
+
74
+ ytDlpArguments . push ( ...serverConfig . crawler . ytDlpArguments ) ;
74
75
ytDlpArguments . push ( "-o" , assetPath ) ;
75
76
ytDlpArguments . push ( "--no-playlist" ) ;
76
77
return ytDlpArguments ;
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ const allEnv = z.object({
49
49
CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE : z . coerce . number ( ) . default ( 50 ) ,
50
50
CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC : z . coerce . number ( ) . default ( 10 * 60 ) ,
51
51
CRAWLER_ENABLE_ADBLOCKER : stringBool ( "true" ) ,
52
+ YTDLP_ARGS : z
53
+ . string ( )
54
+ . default ( "" )
55
+ . transform ( ( t ) => t . split ( "%%" ) . filter ( ( a ) => a ) ) ,
52
56
MEILI_ADDR : z . string ( ) . optional ( ) ,
53
57
MEILI_MASTER_KEY : z . string ( ) . default ( "" ) ,
54
58
LOG_LEVEL : z . string ( ) . default ( "debug" ) ,
@@ -116,6 +120,7 @@ const serverConfigSchema = allEnv.transform((val) => {
116
120
maxVideoDownloadSize : val . CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE ,
117
121
downloadVideoTimeout : val . CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC ,
118
122
enableAdblocker : val . CRAWLER_ENABLE_ADBLOCKER ,
123
+ ytDlpArguments : val . YTDLP_ARGS ,
119
124
} ,
120
125
ocr : {
121
126
langs : val . OCR_LANGS ,
You can’t perform that action at this time.
0 commit comments