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

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
fix the example error occur at `vid.Download(vid.Formats[0], file)`:

**vid.Download undefined, (type *ytdl.VideoInfo has no field or method Download)**
  • Loading branch information
wedojava authored and corny committed Jun 8, 2020
1 parent 440fa5f commit ee74b04
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ import (
"os"

"github.com/rylio/ytdl"
"github.com/rs/zerolog/log"
)

func main() {
vid, err := ytdl.GetVideoInfo("https://www.youtube.com/watch?v=WkVvG4QTO9M")
client := ytdl.Client{
HTTPClient: http.DefaultClient,
Logger: log.Logger,
}
vid, err := client.GetVideoInfo("https://www.youtube.com/watch?v=WkVvG4QTO9M")
if err != nil {
fmt.Println("Failed to get video info")
return
}
file, _ := os.Create(vid.Title + ".mp4")
defer file.Close()
vid.Download(vid.Formats[0], file)
client.Download(vid, vid.Formats[0], file)
}

```
Expand Down

0 comments on commit ee74b04

Please sign in to comment.