knadh / go-get-youtube

A tiny Go library + client for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos.
161 stars 36 forks source link

Add error when trying to download 403 Forbidden videos from Youtube Music #6

Closed MrYakobo closed 6 years ago

MrYakobo commented 6 years ago

If you try to download something from Youtube Music (for example this video) using the utility, the HEAD request in yotube.go:124 would get a 403 Forbidden. This is silently ignored and the routine instead says "Video file is already downloaded" at yotube.go:137. This pull request adds an error check for the 403 Forbidden code.

Also, fixed a typo

MrYakobo commented 6 years ago

Whoops, my bad. I'll correct my mistake :boom:

dbatbold commented 6 years ago

Looks good! @knadh can only merge.

knadh commented 6 years ago

Thanks @dbatbold @MrYakobo