These should check for failure
This commit is contained in:
parent
dc0f9af220
commit
b282f3df37
1 changed files with 8 additions and 0 deletions
|
@ -65,6 +65,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) {
|
||||||
defer videoDLResult.Close()
|
defer videoDLResult.Close()
|
||||||
|
|
||||||
file, err := os.OpenFile(tempPath+"-vid", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
file, err := os.OpenFile(tempPath+"-vid", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
io.Copy(file, videoDLResult)
|
io.Copy(file, videoDLResult)
|
||||||
|
@ -85,6 +89,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) {
|
||||||
defer audioDLResult.Close()
|
defer audioDLResult.Close()
|
||||||
|
|
||||||
file, err := os.OpenFile(tempPath+"-audio", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
file, err := os.OpenFile(tempPath+"-audio", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
io.Copy(file, audioDLResult)
|
io.Copy(file, audioDLResult)
|
||||||
|
|
Loading…
Reference in a new issue