do not download broken files
This commit is contained in:
parent
2b7c578a34
commit
73e6410fd2
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,10 @@ func (i Item) downloadCover() error {
|
||||||
}
|
}
|
||||||
}(resp.Body)
|
}(resp.Body)
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return fmt.Errorf("HTTP status code is %d", resp.StatusCode)
|
||||||
|
}
|
||||||
|
|
||||||
out, err := os.Create(i.targetFilename())
|
out, err := os.Create(i.targetFilename())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue