gofmt
j3s j3s@c3f.net
Wed, 17 Mar 2021 15:58:06 -0500
1 files changed,
7 insertions(+),
7 deletions(-)
jump to
M
main.go
→
main.go
@@ -2,8 +2,8 @@ package main
import ( "flag" - "io" "fmt" + "io" "os" "path/filepath" "sort"@@ -47,31 +47,31 @@ return
} if strings.HasPrefix(e.Message, "<a href=\"https://youtube") == true { fmt.Println("downloading...") - videoID := "BaW_jenozKc" - client := youtube.Client{} + videoID := "BaW_jenozKc" + client := youtube.Client{} video, err := client.GetVideo(videoID) if err != nil { - fmt.Println(err) + fmt.Println(err) return } resp, err := client.GetStream(video, &video.Formats[0]) if err != nil { - fmt.Println(err) + fmt.Println(err) return } defer resp.Body.Close() file, err := os.Create("video.mp4") if err != nil { - fmt.Println(err) + fmt.Println(err) return } defer file.Close() _, err = io.Copy(file, resp.Body) if err != nil { - fmt.Println(err) + fmt.Println(err) return } }