Skip to content

Commit

Permalink
Adding nod description to download with yt-dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
boggydigital committed Dec 11, 2024
1 parent 344d147 commit f9cf1dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/download_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@ func downloadVideo(

func downloadWithYtDlp(videoId, absFilename string) error {

dyda := nod.Begin(" downloading %s with yt-dlp, please wait...", videoId)
defer dyda.EndWithResult("done")

absDir, _ := path.Split(absFilename)
if _, err := os.Stat(absDir); os.IsNotExist(err) {
if err := os.MkdirAll(absDir, 0755); err != nil {
return err
return dyda.EndWithError(err)
}
}

Expand All @@ -167,7 +170,7 @@ func downloadWithYtDlp(videoId, absFilename string) error {

ytDlpDir, err := pathways.GetAbsDir(paths.YtDlp)
if err != nil {
return err
return dyda.EndWithError(err)
}

absYtDlpFilename := filepath.Join(ytDlpDir, yeti.GetYtDlpBinary())
Expand Down

0 comments on commit f9cf1dc

Please sign in to comment.