Waifuvault 1.1.0
See the version list below for details.
dotnet add package Waifuvault --version 1.1.0
NuGet\Install-Package Waifuvault -Version 1.1.0
<PackageReference Include="Waifuvault" Version="1.1.0" />
paket add Waifuvault --version 1.1.0
#r "nuget: Waifuvault, 1.1.0"
// Install Waifuvault as a Cake Addin #addin nuget:?package=Waifuvault&version=1.1.0 // Install Waifuvault as a Cake Tool #tool nuget:?package=Waifuvault&version=1.1.0
waifuvault-C#-api
This contains the official API bindings for uploading, deleting and obtaining files with waifuvault.moe. Contains a full up to date API for interacting with the service
Installation
dotnet add package Waifuvault
Usage
This API contains 4 interactions:
- Upload File
- Get File Info
- Delete File
- Get File
The package is namespaced to Waifuvault
, so to import it, simply:
using Waifuvault;
Upload File
To Upload a file, use the uploadFile
function. This function takes the following options as an object:
Option | Type | Description | Required | Extra info |
---|---|---|---|---|
filename |
string |
The path to the file to upload | true if File | File path |
url |
string |
The URL of the file to target | true if URL | Filename with extension |
buffer |
byte array |
Byte array containing file to upload | true if buffer | Needs filename set also |
expires |
string |
A string containing a number and a unit (1d = 1day) | false | Valid units are m , h and d |
hideFilename |
boolean |
If true, then the uploaded filename won't appear in the URL | false | Defaults to false |
password |
string |
If set, then the uploaded file will be encrypted | false |
Using a URL:
using Waifuvault;
var upload_file = new Waifuvault.FileUpload("https://waifuvault.moe/assets/custom/images/08.png");
var upload_resp = await Waifuvault.Api.uploadFile(upload_file);
Console.WriteLine(upload_resp.url);
Using a file path:
using Waifuvault;
var upload_file = new Waifuvault.FileUpload("../aCoolFile.png");
var upload_resp = await Waifuvault.Api.uploadFile(upload_file);
Console.WriteLine(upload_resp.url);
Using a buffer:
using Waifuvault;
using System.IO;
byte[] buffer = File.ReadAllBytes("./aCoolFile.png");
var upload_file = new Waifuvault.FileUpload(buffer,"aCoolFile.png");
var upload_resp = await Waifuvault.Api.uploadFile(upload_file);
Console.WriteLine(upload_resp.url);
Get File Info
If you have a token from your upload. Then you can get file info. This results in the following info:
- token
- url
- protected
- retentionPeriod
Use the fileInfo
function. This function takes the following options as parameters:
Option | Type | Description | Required | Extra info |
---|---|---|---|---|
token |
string |
The token of the upload | true | |
formatted |
boolean |
If you want the retentionPeriod to be human-readable or an epoch |
false | defaults to false |
using Waifuvault;
var token_info = await Waifuvault.Api.fileInfo(upload_resp.token,false);
Console.WriteLine(token_info.url);
Console.WriteLine(token_info.retentionPeriod);
Human-readable timestamp:
using Waifuvault;
var token_info = await Waifuvault.Api.fileInfo(upload_resp.token,true);
Console.WriteLine(token_info.url);
Console.WriteLine(token_info.retentionPeriod);
Delete File
To delete a file, you must supply your token to the deletefile
function.
This function takes the following options as parameters:
Option | Type | Description | Required | Extra info |
---|---|---|---|---|
token |
string |
The token of the file you wish to delete | true |
using Waifuvault;
var deleted = await Waifuvault.Api.deleteFile(token);
Console.WriteLine(deleted);
Get File
This lib also supports obtaining a file from the API as a Buffer by supplying either the token or the unique identifier of the file (epoch/filename).
Use the getFile
function. This function takes the following options an object:
Option | Type | Description | Required | Extra info |
---|---|---|---|---|
token |
string |
The token of the file you want to download | true only if filename is not set |
if filename is set, then this can not be used |
url |
string |
The URL of the file | true only if token is not set |
if token is set, then this can not be used |
password |
string |
The password for the file | true if file is encrypted | Passed as a parameter on the function call |
Important! The Unique identifier filename is the epoch/filename only if the file uploaded did not have a hidden filename, if it did, then it's just the epoch. For example:
1710111505084/08.png
is the Unique identifier for a standard upload of a file called08.png
, if this was uploaded with hidden filename, then it would be1710111505084.png
Obtain an encrypted file
using Waifuvault;
var file = new FileResponse(token:your_token);
var downloaded = await Waifuvault.Api.getFile(file,"password");
Console.WriteLine(downloaded.Length);
Obtain a file from URL
using Waifuvault;
var file = new FileResponse(url:your_url);
var downloaded = await Waifuvault.Api.getFile(file);
Console.WriteLine(downloaded.Length);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.7 | 141 | 9/11/2024 |
1.3.6 | 113 | 8/26/2024 |
1.3.5 | 117 | 8/20/2024 |
1.3.4 | 108 | 5/17/2024 |
1.3.3 | 86 | 5/13/2024 |
1.3.2 | 122 | 4/22/2024 |
1.3.1 | 123 | 4/20/2024 |
1.3.0 | 124 | 4/3/2024 |
1.2.9 | 119 | 4/3/2024 |
1.2.8 | 103 | 4/2/2024 |
1.2.7 | 111 | 4/2/2024 |
1.2.6 | 116 | 3/27/2024 |
1.2.5 | 105 | 3/27/2024 |
1.2.4 | 116 | 3/21/2024 |
1.2.3 | 119 | 3/20/2024 |
1.2.2 | 105 | 3/20/2024 |
1.2.1 | 105 | 3/20/2024 |
1.2.0 | 120 | 3/20/2024 |
1.1.9 | 118 | 3/20/2024 |
1.1.8 | 122 | 3/18/2024 |
1.1.7 | 117 | 3/17/2024 |
1.1.6 | 128 | 3/17/2024 |
1.1.5 | 112 | 3/17/2024 |
1.1.4 | 129 | 3/17/2024 |
1.1.3 | 129 | 3/16/2024 |
1.1.2 | 115 | 3/16/2024 |
1.1.1 | 128 | 3/16/2024 |
1.1.0 | 141 | 3/15/2024 |
1.0.9 | 124 | 3/15/2024 |
1.0.8 | 108 | 3/14/2024 |
1.0.7 | 149 | 3/14/2024 |
1.0.6 | 137 | 3/12/2024 |
1.0.5 | 132 | 3/12/2024 |
1.0.4 | 124 | 3/12/2024 |
1.0.3 | 128 | 3/12/2024 |
1.0.2 | 142 | 3/12/2024 |
1.0.1 | 136 | 3/12/2024 |
1.0.0 | 132 | 3/12/2024 |