Giter Site home page Giter Site logo

davidchalifoux / kaput-cli Goto Github PK

View Code? Open in Web Editor NEW
61.0 4.0 7.0 632 KB

The unofficial CLI client for Put.io - Kaput lets you manage your Put.io account from the comfort of your terminal!

Home Page: https://kaput.sh/

License: MIT License

Rust 100.00%
cli put putio rust rust-lang

kaput-cli's Introduction

Hello! ๐Ÿ‘‹

I'm David, a developer who loves the web.

kaput-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kaput-cli's Issues

Play - new feature request to play videos using mpv.

It would be nice to be able to type:

kaput files play ID

and have kaput launch mpv to start playing the requested video. Seems like an easy feature to add. You can reuse the download URL you already generate via "kaput files URL".

If you pass it a file, it plays the file. If you pass it a folder, it generates a playlist and plays the files in the folder that are video files.

Upload from CLI

It'd be nice to be able to also upload files to Put from the CLI.

Support for JSON output?

It'd be great if there could be a --json or --output json option that outputs a single json record per line, for the files and transfers commands that output a table.

Download folder throws error during check zip status "invalid type: null, expected a string"

Release v2.1.1 file kaput-x86_64-unknown-linux-gnu.tar.gz

kaput files download FILE_ID

Creating ZIP...
thread 'main' panicked at src/put/zips.rs:25:70:
checking zip status: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 25) }
 0:     0x5629045f520c - <unknown>
 1:     0x56290462245c - <unknown>
 2:     0x5629045f198e - <unknown>
 3:     0x5629045f4ff4 - <unknown>
 4:     0x5629045f66a3 - <unknown>
 5:     0x5629045f63bc - <unknown>
 6:     0x5629045f6c29 - <unknown>
 7:     0x5629045f6b27 - <unknown>
 8:     0x5629045f5736 - <unknown>
 9:     0x5629045f6872 - <unknown>
10:     0x5629040cd833 - <unknown>
11:     0x5629040cdc3a - <unknown>
12:     0x5629041132f5 - <unknown>
13:     0x5629040ec9dc - <unknown>
14:     0x56290410b923 - <unknown>
15:     0x5629041105b9 - <unknown>
16:     0x5629045ec1db - <unknown>
17:     0x5629040ed585 - <unknown>
18:     0x7fec9c029d90 - __libc_start_call_main
                             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
19:     0x7fec9c029e40 - __libc_start_main_impl
                             at ./csu/../csu/libc-start.c:392:3
20:     0x5629040cdef5 - <unknown>
21:                0x0 - <unknown>

autocomplete fails

I am unable to get any autocomplete commands to work, with or without a shell argument.

Any idea what I should try, what might be wrong?

Paul

$ kaput autocomplete
Building the autocomplete cache... !
TypeError: Cannot read property 'replace' of null
    at sanitizeDescription (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:12:10)
    at /usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:113:45
    at Array.map (<anonymous>)
    at Create.genZshFlagSpecs (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:108:14)
    at /usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:135:12
    at Array.map (<anonymous>)
    at Create.get genCaseStatementForFlagsMetaString [as genCaseStatementForFlagsMetaString] (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:132:30)
    at Create.get zshCompletionFunction [as zshCompletionFunction] (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:209:48)
    at Create.createFiles (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:37:65)
    at async Create.run (/usr/local/lib/node_modules/kaput-cli/node_modules/@oclif/plugin-autocomplete/lib/commands/autocomplete/create.js:23:9)

Upload parent directory

Is it possible to specify the parent directory you want putio to put the completed file after a kaput file upload?

Right now it all goes to my default folder, but I'd like to go to a specific putio folder.

I saw the previous issue #6 and there's an option in there for parent_id= however I don't see how to use it on the CLI.

Thank you for a cool tool!

New Features: Recursive and multiple downloads

New feature requests:

  • -r | --recursive - Recursively download folder and contents without zipping
  • -i | --input FILE_NAME - Use a text file as input for download. One FILE_ID per line

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

Add Filters from API

Currently on the files command, there is no way to use the available sort_by, content_type, or file_type filters available. This should be included to make it easier to search for something specific.

handle pagination in lists

Currently, list commands do not take pagination into account. If someone has a folder with greater than pagesize files, Kaput will not display them all.

Support multiple users

When there are several accounts to be used, it'd be nice to pass an account name, like --profile main or --profile friend1, and have that used as a key in the configuration file.

So the config file would change from:

{ 
  "authCode": "aaaaaa",
  "accessToken": "bbbbbbbbb"
}

To:

{
  "default": { 
    "authCode": "aaaaaa",
    "accessToken": "bbbbbbbbb"
  }
}

And additional profiles can be logged into and used via the --profile option to all the commands.

(It'd also be nice to take the profile from the environment variable PUTIO_PROFILE if one isn't passed on the command line, and then default to default if the env var is empty too...)

Sorry for all the requests, I appreciate your time!

List --all option to list all files?

It would be useful to have either an all command, or --all option to the list command, which would use the API feature to list all files by passing parent_id=-1.

Coupled with the option for JSON output, it'd make it easy to use jq and other tools to do complex queries.

There are some optional parameters to include additional metadata; it might make sense to enable them, since it's easier for the user to throw away information than to not have it at all.

Thanks for the awesome work!

Paul

Need to fetch parent folder of fileid

I'm writing a script to categorize downloaded items, but to properly do so I need the parent folder info. Running kaput files obviously gets items whose parent_id equals the designated id, but getting the parent_id of the designated id would be great. Maybe a flag "--self" that could output the data for the ID instead of the contents?

My alternative has been to loop through folders until it finds one with that ID to determine the parent folder ID.

Expose crate as lib

I was hoping to use this crate as a lib, so I can write my own automation.

I'm happy to do it but it might be better suited in its own crate because of the -cli part of the name.

Also, a consumer of the lib might want async rather than blocking, but that can be added on later via features.

Listing transfers with active transfer causes error

I started a transfer and then, in a new terminal window, tried to list transfers and got this error:

thread 'main' panicked at 'fetching transfers: reqwest::Error { kind: Decode, source: Error("invalid type: null, expected u32", line: 1, column: 1268) }', /Users/joshkerr/.cargo/registry/src/github.com-1ecc6299db9ec823/kaput-cli-2.0.0/src/main.rs:473:60
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.