From e1056f0d84c0094eb697260457ca39b69db73d77 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 22 Sep 2023 05:42:03 +0300 Subject: [PATCH] yt-dlp flags: concurrnet fragments help in download time --- downloader.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/downloader.go b/downloader.go index c05ff32..0193a86 100644 --- a/downloader.go +++ b/downloader.go @@ -11,6 +11,8 @@ import ( const YT_DLP string = "yt-dlp" const YT_DLP_FLAG_GET_TITLE string = "--get-title" +const YT_DLP_FLAG_EMBED_METADATA string = "--embed-metadata" +const YT_DLP_FLAG_CONCURRENT_FRAGMENTS string = "--concurrent-fragments 4" const JOB_STATUS_NEW = 1 const JOB_STATUS_COMPLETED = 2 @@ -109,7 +111,13 @@ func startJob(ctx *DownloadCtx, downloadCtxs chan *DownloadCtx) { func getTitle(ctx *DownloadCtx) { - cmd := exec.Command(YT_DLP, YT_DLP_FLAG_GET_TITLE, ctx.link) + cmd := exec.Command( + YT_DLP, + YT_DLP_FLAG_GET_TITLE, + YT_DLP_FLAG_EMBED_METADATA, + YT_DLP_FLAG_CONCURRENT_FRAGMENTS, + ctx.link, + ) stdout, err := cmd.Output() if err != nil { ctx.err = &err