misobarisic / redgifs-downloader

Downloading videos from RedGIFs has never been easier
https://www.npmjs.com/package/redgifs-downloader
MIT License
48 stars 3 forks source link

Quality of life when downloading files from users with many gifs #12

Closed Infuser2021 closed 3 years ago

Infuser2021 commented 3 years ago

Hey, thanks for this project. I found that some videos always give the error "const size = gfycat.content_urls.mp4.size TypeError: Cannot read property 'size' of undefined." Dunno why, but this error persists when restarting the process. A yolo solution was just to put a trycatch around everything in the download function starting from that row.

Also, to avoid redownloading everything from the user the second time, I had to add a conditional "if (!fs.existsSync(finalPath)) { }" around all the downloading stuff, then I just added the recursive download call to the else too. Because all the videos have unique names across the site, this approach should work so we can download just the new stuff from users when they post more.

Maybe you could do something with this info, cheers.

misobarisic commented 3 years ago

Up until now, the main library already had an auto skip feature built in. It would always skip. Now it's turned off by default and can be modified in the same way as all other Options.

I have promptly dropped support for the cli as it was outdated and I believe using the actual library in a script gives you better control over the way files are downloaded and filtered. If you wish to create your own cli.js and make a pull request, feel free to. As of right now I will not be dedicating any time to the cli.