From 4fc2721dc153a0d485768c46ad3ee4b282fefb05 Mon Sep 17 00:00:00 2001 From: Roman Romanenko Date: Thu, 9 Apr 2020 22:28:42 +0300 Subject: [PATCH] refs #86; update cmd utility; --- cmd/ytdl/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/ytdl/main.go b/cmd/ytdl/main.go index 8da6860..12fe3bf 100644 --- a/cmd/ytdl/main.go +++ b/cmd/ytdl/main.go @@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "io" "net/http" @@ -10,7 +11,7 @@ import ( "encoding/json" - "github.com/mattn/go-isatty" + isatty "github.com/mattn/go-isatty" "github.com/olekukonko/tablewriter" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -168,7 +169,7 @@ func handler(identifier string, options options) { log.Info().Msg("Fetching video info...") //fmt.Print("\u001b[0G") //fmt.Print("\u001b[2K") - info, err := client.GetVideoInfo(identifier) + info, err := client.GetVideoInfo(context.Background(), identifier) if err != nil { err = fmt.Errorf("Unable to fetch video info: %w", err) return @@ -245,7 +246,7 @@ func handler(identifier string, options options) { return } format := formats[0] - downloadURL, err := client.GetDownloadURL(info, format) + downloadURL, err := client.GetDownloadURL(context.Background(), info, format) if err != nil { err = fmt.Errorf("Unable to get download url: %w", err) return