mirror of
https://github.com/Waradu/to-streamshare.git
synced 2025-04-21 11:54:08 +02:00
init
This commit is contained in:
commit
27ac40966f
6 changed files with 1809 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
1752
Cargo.lock
generated
Normal file
1752
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
20
Cargo.toml
Normal file
20
Cargo.toml
Normal file
|
@ -0,0 +1,20 @@
|
|||
[package]
|
||||
name = "to-streamshare"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Upload to streamshare (to-ss > toss) from the terminal"
|
||||
license = "MIT"
|
||||
homepage = "https://waradu.dev"
|
||||
repository = "https://github.com/Waradu/to-streamshare"
|
||||
readme = "README.md"
|
||||
authors = ["Waradu"]
|
||||
keywords = ["streamshare","file-sharing","upload"]
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.5.20", features = ["derive"] }
|
||||
streamshare = "1.0.0"
|
||||
tokio = { version = "1.40.0", features = ["full"] }
|
||||
|
||||
[[bin]]
|
||||
name = "toss"
|
||||
path = "src/main.rs"
|
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# To Streamshare
|
||||
|
||||
Upload files to [streamshare](https://streamshare.wireway.ch) with the terminal.
|
||||
|
||||
Run `cargo install to-streamshare` to install it and use it with `toss "filepath"`
|
30
src/main.rs
Normal file
30
src/main.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
use clap::Parser;
|
||||
use streamshare::upload;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Args {
|
||||
file: Option<String>,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let args = Args::parse();
|
||||
|
||||
if let Some(file_path) = args.file {
|
||||
match upload(&file_path).await {
|
||||
Ok((file_identifier, _deletion_token)) => {
|
||||
let download_url = format!(
|
||||
"https://streamshare.wireway.ch/download/{}",
|
||||
file_identifier
|
||||
);
|
||||
|
||||
println!("File uploaded successfully");
|
||||
println!("Download URL: {}", download_url);
|
||||
}
|
||||
Err(e) => eprintln!("Error: {}", e),
|
||||
}
|
||||
} else {
|
||||
eprintln!("Please provide a file path");
|
||||
}
|
||||
}
|
1
test.txt
Normal file
1
test.txt
Normal file
|
@ -0,0 +1 @@
|
|||
hello
|
Loading…
Add table
Add a link
Reference in a new issue