goeland instead of the script it's way easier

This commit is contained in:
2025-08-09 00:56:31 +02:00
parent 7bff9a9342
commit c33e325882
3 changed files with 45 additions and 7 deletions

View File

@@ -49,17 +49,28 @@ func main() {
datestr := date.Format("2006-01-02T15:04:05Z")
videosstr := "https://www.googleapis.com/youtube/v3/search/?channelId={{.Id}}&part={{.Part}},id&order={{.Order}}&publishedAfter={{.Date}}&key={{.Key}}"
templ, err := template.New("test").Parse(videosstr)
for i, val := range output {
if err != nil {
fmt.Println(err)
return
}
for _, val := range output {
temp := videourl{val.Id, "snippet", "date", datestr, apikey}
var output bytes.Buffer
templ.Execute(&output, temp)
resp, err := http.Get(output.String())
if err != nil {
fmt.Println(err)
continue
}
body, err := io.ReadAll(resp.Body)
fmt.Println(string(body))
fmt.Println(i)
fmt.Println(err)
if err != nil {
fmt.Println(err)
continue
}
if resp.StatusCode != 200 {
fmt.Println(resp)
} else {
fmt.Println(string(body))
}
}
fmt.Println(output)
fmt.Println(apikey)
}