Created
April 27, 2019 15:40
-
-
Save yene/1f4f7da1ba2955590246480e8a17d802 to your computer and use it in GitHub Desktop.
grab bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"github.com/cavaliercoder/grab" | |
) | |
func main() { | |
client := grab.NewClient() | |
testURLs := []string{ | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59665dfd12eb088169fe65a0/3c1ea606328206cdaa4779183fa60bdb/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59665dfd12eb088169fe65a0/5919e309ae7c224866bdd86b8754eb4a/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59665dfd12eb088169fe65a0/c9fa038dd9a5ab49abc892461db1af20/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59665dfd12eb088169fe65a0/56e7100404266786f143a6208bea7d03/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59665dfd12eb088169fe65a0/fcad1b699f4f83cae0b0806b7cce305a/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/5988b8db068703f9acb79d9d/c888677f34d88535bfbe5aba0f5551f0/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/5963817185b2b8ef4a609a61/632df52ed8be7531cafe75561859c4b3/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/59b79816f3b0ebf48a38e675/307f8c3c99325e63a774153de73ab676/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/590a2628d69cf17f0057e586/395ca22a5c64de19ae91498d17f0ef3c/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/590b330ebcf64eb30dcf7aac/6c321b0be9d7259751813e8af8026681/image.png", | |
"https://trello-attachments.s3.amazonaws.com/52460829b7e0c8990b00008e/590b330ebcf64eb30dcf7aac/32e8975256b6d50dd016f0a068d8a64b/image.png", | |
} | |
for _, url := range testURLs { | |
req, _ := grab.NewRequest(".", url) | |
resp := client.Do(req) | |
log.Println("finished download") | |
if err := resp.Err(); err != nil { | |
log.Println("Could not download", url) | |
log.Fatalln(err) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment