davidchalifoux / kaput-cli

The unofficial CLI client for Put.io - Kaput lets you manage your Put.io account from the comfort of your terminal!
https://kaput.sh/
MIT License
68 stars 7 forks source link

New Features: Recursive and multiple downloads #49

Closed kylepmanuel closed 1 month ago

kylepmanuel commented 7 months ago

New feature requests:

Recursively download a folder and it's contents without zipping:

kaput files download -r FILE_ID

Download all files/folders listed by id from an input file. This would still zip folders:

kaput files download -i downloads.txt

Download all files/folders listed by id from an input file recursively. No zipping of folders:

kaput files download -ir downloads.txt

Possibly allow piping as input which would effectively mean this command downloads everything recursively without zipping:

kaput files list | perl -ne '/^\|\s(\d{8,10})\s+\|/ && print "$1\n";' | kaput files download -r

or if you are in the mood for formatting output something like this:

kaput files list -o '{id}\n' | kaput files download -r

where {field_name} is one of the available fields printed from kaput files list headers

davidchalifoux commented 7 months ago

Can you explain the use case for this? Why doesn't a ZIP suffice?

kylepmanuel commented 7 months ago

Example 1:

I have 100Gb free space on a drive. I want to download a folder whose contents totals 60Gb. I don't have enough room to download the zip and then extract it.

Example 2:

I am setting up local on-prem backup. This would be an initial "download all" without any extra processes.

Example 3:

Honestly, I'm lazy and don't want an extra step.

jklausa commented 3 months ago

I wanted to +1 the -r flag.

I am often downloading files directly to my media HDD, and unzipping often takes longer than the download itself.

(I know having 2Gbps downlink and slow spinning rust HDDs is not exactly a super common combination, but it would be nice to be able to wait less on things :) )

davidchalifoux commented 2 months ago

I wanted to +1 the -r flag.

I am often downloading files directly to my media HDD, and unzipping often takes longer than the download itself.

(I know having 2Gbps downlink and slow spinning rust HDDs is not exactly a super common combination, but it would be nice to be able to wait less on things :) )

Alright, I’ll try to get to this when I can.

davidchalifoux commented 1 month ago

Got an initial version of recursive downloads working. If you would like to test it, try running the branch: https://github.com/davidchalifoux/kaput-cli/tree/feat/recursive-downloads

Notes:

Give it a try and let me know if you have feedback. I'm hoping to have it in a release this weekend.

davidchalifoux commented 1 month ago

Recursive downloads are now available in v2.4.0. I'll work on adding multiple downloads and potentially input files as well.

Let me know if I broke anything. I did a lot of refactoring.

kylepmanuel commented 1 month ago

I have tried this with 3 different folders with varying structures. Everything appears to have downloaded correctly. I have not retried many other features, but this does work.

jklausa commented 1 month ago

I also checked it out recently, and worked perfectly — appreciate your work!