Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refs #86; update cmd utility; #1

Merged
merged 1 commit into from
Apr 11, 2020
Merged
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