huydx/hget

Download folder collision

lukechilds opened this issue · 0 comments

If I download https://google.com/file.txt it looks like the directory for saving the progress is ~/.hget/file.txt. Is that correct?

If so, what if I pause and then start downloading https://github.com/file.txt, wouldn't they both be saved in ~/.hget/file.txt.

It looks like you're just using the basename to specify a download job

hget/util.go

Line 68 in 03213a9

func TaskFromUrl(url string) string {

I think the download task/folder should be the full url encoded in a way that's safe as a folder name, either a hash of the url or just encode some of the url params.