Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

refs #86; update cmd utility; #96

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/ytdl/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"fmt"
"io"
"net/http"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down