Moorad / youtube-video-downloader

199 stars 138 forks source link

[question] why a.click over window.open #31

Closed mirsella closed 4 years ago

mirsella commented 4 years ago

hello, i was wondering if there was a reason to use the hacky and longer way of creating a href element and click() on it instead of using window.open() ? I would be happy to know as I'm trying to do a yt downloader but I've got problem figuring out how to download multiple files (playlists) as when opening multiple window the browser blocks it as pop up, since it tries to open multiple window. I don't know if there is a better way. thanks

Moorad commented 4 years ago

Oh, I actually didn't notice that change. In the original version (which is the one shown in the blog) I was using window.location.href to redirect the user. That was changed by @Paulo1234 but from what I know there isn't much of a difference.

A few weeks ago I made an example code for someone that uses download.js to directly download the video file in the page rather than redirecting. You might want to take look at that (I've attached a zip file)

single window download example.zip

Moorad commented 4 years ago

sorry for the late reply btw, if you have any more questions feel free to post them here. Once you are done with everything feel free to close this issue.

mirsella commented 4 years ago

yay, I've look into download.js but didn't find a way to download the file(s) with it. thanks a lot i'll look into it and change my code :) downloading a playlist was a pain in browser tabs lol, I hope it work for multiple videos