From ce88dc70f4a4a71d37f5099cb1722371522a991b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 04:33:39 +0000 Subject: [PATCH] Preserve critical defaults and improve comments Co-authored-by: krau <71133316+krau@users.noreply.github.com> --- client/bot/handlers/ytdlp.go | 2 ++ core/tasks/ytdlp/execute.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/bot/handlers/ytdlp.go b/client/bot/handlers/ytdlp.go index 4647f54..4140afa 100644 --- a/client/bot/handlers/ytdlp.go +++ b/client/bot/handlers/ytdlp.go @@ -43,6 +43,8 @@ func handleYtdlpCmd(ctx *ext.Context, update *ext.Update) error { nextArg := strings.TrimSpace(args[i+1]) if nextArg != "" && !strings.HasPrefix(nextArg, "-") { // Check if it's clearly a URL (has ://) + // This handles common video URLs (http://, https://) + // For other yt-dlp inputs, users should ensure proper formatting if strings.Contains(nextArg, "://") { // It's a URL, don't consume it as a flag value continue diff --git a/core/tasks/ytdlp/execute.go b/core/tasks/ytdlp/execute.go index 2c11b7e..20bb362 100644 --- a/core/tasks/ytdlp/execute.go +++ b/core/tasks/ytdlp/execute.go @@ -80,7 +80,8 @@ func (t *Task) Execute(ctx context.Context) error { func (t *Task) downloadFiles(ctx context.Context, tempDir string) ([]string, error) { logger := log.FromContext(ctx) - // Configure yt-dlp command with default settings + // Configure yt-dlp command with essential settings + // Always set output path to ensure files go to temp directory cmd := ytdlp.New(). Output(filepath.Join(tempDir, "%(title)s.%(ext)s")) @@ -91,6 +92,8 @@ func (t *Task) downloadFiles(ctx context.Context, tempDir string) ([]string, err RecodeVideo("mp4"). RestrictFilenames() } + // Note: If custom flags are provided, users have full control over format/quality + // The output path is always set above to ensure downloads go to the correct directory if t.Progress != nil { t.Progress.OnProgress(ctx, t, "Downloading...")