tanishqmanuja / apkmirror-downloader

📥 Download apps from APKMirror with ease.
https://www.npmjs.com/package/apkmirror-downloader
MIT License
35 stars 8 forks source link

Feature: Download only if not exist #20

Closed ddubnyk closed 1 month ago

ddubnyk commented 1 month ago

First off, I see a lot of potential here so far from my minimal use. Gone a long way to creating my own private Fdroid Repo.

I was wondering if there would be a way to make it so it only downloads the apk if the file doesn't already exist in the outdir? Currently it seems to always download even if its already there and overwrites the existing file. This could help save on bandwidth and potentially prevent rate limiting when scripting this for checking for updates.

tanishqmanuja commented 1 month ago

It would be possible to not save the file when it already exists. True, it would save bandwidth. But this wouldn't prevent rate limiting as to know the download file name app would still have to send the requests.

tanishqmanuja commented 1 month ago

Option to skip download by specifying overwrite: false in v2.0.6. Default behavior remains the same as previous version which is to overwrite previous downloads.

ddubnyk commented 1 month ago

You're awesome man! Will try it out today! Thanks

ddubnyk commented 1 month ago

I'm not sure this is working yet. Here is how I have my json setup

{ "options": { "outDir": "/downloads", "type": "apk", "overwrite": "false" }, "apps": [ { "org": "digibites", "repo": "accubattery" }, { "org": "cibc", "repo": "cibc-mobile-banking" }, { "org": "cx-file-explorer", "repo": "cx-file-explorer" } ] }

Yet it seems to still be downloading and overwriting the files in my directory, changing the modified time and all. Is this the correct configuration?

tanishqmanuja commented 1 month ago

Can you try false without quotes once and post the output ?

ddubnyk commented 1 month ago

Ah that was the fix! That worked perfectly thanks!

tanishqmanuja commented 1 month ago

Yeah 💯