small pixel drawing of a pufferfish neoarkbot

gofmt
j3s j3s@c3f.net
Wed, 17 Mar 2021 15:58:06 -0500
commit

21d001c834598809496ffc0624459502a1f09b08

parent

7b3805f79ffaa61403f7d1a3b2d585dfc8b1eae5

1 files changed, 7 insertions(+), 7 deletions(-)

jump to
M main.gomain.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 } }