mediaflow

Crates.iomediaflow
lib.rsmediaflow
version0.9.0
sourcesrc
created_at2022-05-02 07:48:23.70928
updated_at2022-09-26 20:27:19.172028
descriptionUnofficial SDK to interact with the Mediaflow Pro API
homepagehttps://github.com/jacobsvante/mediaflow
repositoryhttps://github.com/jacobsvante/mediaflow
max_upload_size
id578925
size80,737
Jacob Magnusson (jacobsvante)

documentation

https://docs.rs/mediaflow/

README

mediaflow Rust SDK

This is an unofficial Rust SDK for Mediaflow.

API documentation can be found here: https://static.mediaflowpro.com/doc/

Supports both programmatic and CLI usage (via cli feature).

Beta quality disclaimer

The project's API is still very much in fluctuation. Pin your dependency to the current minor version to avoid breaking changes. From 1.0 and forward we will keep a stable API.

CLI

This is the easiest way to get started. To find out what you can do with the CLI, just append --help or -h to the installed mediaflow command.

Please note that you need to add the cli feature for CLI access. Using cargo-edit you can do this by calling: cargo add mediaflow --features cli

Config file

It's recommended to create an INI config file before using the CLI (see previous section on setup), to avoid having to provide all OAuth 2 details with every command execution.

You can use mediaflow default-ini-path to find the default INI config location.

mediaflow default-ini-path

Write your settings to the file, in this example using heredoc syntax:

cat <<EOF >"$(mediaflow default-ini-path)"
[sandbox]
client_id = 2tGLiKv
client_secret = eu9ZIGXcGNFY8bw0gjQYeNuNoBmk7G
username = email@example.com
password = myPassword
EOF

After this you just have to provide the section name to start using the CLI:

mediaflow rest-api folder-files --full --recursive 123456

Environment variables

As an alternative you can provide environment variables directly. For example:

export CLIENT_ID=2tGLiKv
export CLIENT_SECRET=eu9ZIGXcGNFY8bw0gjQYeNuNoBmk7G
export USERNAME=email@example.com
export PASSWORD=myPassword
mediaflow rest-api folder-files -F -r 567890

Programmatic access

See example below on how to integrate into your code.

use mediaflow::{Config, RestApi, FileFull};

let config = Config::new(
    "2tGLiKv",
    "eu9ZIGXcGNFY8bw0gjQYeNuNoBmk7G",
    "email@example.com",
    "myPassword",
);
let api = RestApi::new(config);
let files = api.get_folder_files_recursive(123456).await?;
println!("Folder with ID 123456 contains {} files", files.len());
Commit count: 65

cargo fmt