From 199017a0a37d78b00ff4163b7e9cb525513e3722 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Wed, 16 Aug 2023 17:30:50 +0200 Subject: [PATCH] Remove probe start callback as goutubedl is now quicker --- dl.go | 7 +------ queue.go | 3 --- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dl.go b/dl.go index 0b7297e..6fa11e6 100644 --- a/dl.go +++ b/dl.go @@ -11,12 +11,10 @@ import ( const downloadAndConvertTimeout = 5 * time.Minute -type ProbeStartCallbackFunc func(ctx context.Context) type ConvertStartCallbackFunc func(ctx context.Context, videoCodecs, audioCodecs, convertActionsNeeded string) type UpdateProgressPercentCallbackFunc func(progressStr string, progressPercent int) type Downloader struct { - ProbeStartFunc ProbeStartCallbackFunc ConvertStartFunc ConvertStartCallbackFunc UpdateProgressPercentFunc UpdateProgressPercentCallbackFunc } @@ -33,6 +31,7 @@ func (d *Downloader) downloadURL(dlCtx context.Context, url string) (rr *ReReadC Type: goutubedl.TypeSingle, DebugLog: goYouTubeDLLogger{}, // StderrFn: func(cmd *exec.Cmd) io.Writer { return io.Writer(os.Stdout) }, + NoInfoDownload: true, MergeOutputFormat: "mkv", // This handles VP9 properly. yt-dlp uses mp4 by default, which doesn't. SortingFormat: "res:720", // Prefer videos no larger than 720p to keep their size small. }) @@ -58,10 +57,6 @@ func (d *Downloader) DownloadAndConvertURL(ctx context.Context, url string) (r i UpdateProgressPercentCallback: d.UpdateProgressPercentFunc, } - if d.ProbeStartFunc != nil { - d.ProbeStartFunc(ctx) - } - if err := conv.Probe(rr); err != nil { return nil, err } diff --git a/queue.go b/queue.go index c20aeb8..546d54e 100644 --- a/queue.go +++ b/queue.go @@ -195,9 +195,6 @@ func (q *DownloadQueue) processQueueEntry(ctx context.Context, qEntry *DownloadQ qEntry.editReply(ctx, processStartStr) downloader := Downloader{ - ProbeStartFunc: func(ctx context.Context) { - qEntry.editReply(ctx, "🎬 Getting video format...") - }, ConvertStartFunc: func(ctx context.Context, videoCodecs, audioCodecs, convertActionsNeeded string) { q.currentlyDownloadedEntry.sourceCodecInfo = "🎬 Source: " + videoCodecs if audioCodecs == "" {