Giter Site home page Giter Site logo

ca1r7 / node-annonfiles Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 101 KB

Anonfiles unofficial API for uploading and downloading files

Home Page: https://anonfiles.com

License: Apache License 2.0

JavaScript 6.13% TypeScript 93.87%
upload download annonymous files annonfiles anonfiles anonfiles-cli anonymous uploading cloud

node-annonfiles's Introduction

node-annonfiles

Annonfiles is unofficial API for uploading and downloading files.

Installation

if you are using NPM :

npm install node-annonfiles

or YARN :

yarn add node-annonfiles

Usage

const { upload, getInfo, download } = require("node-annonfiles");

(async () => {
  try {
    // If you have not keyAcess let it empty
    const uploadFile = await upload("./file.txt", { key: "PUT_KEYACCESS" });
    console.log(uploadFile); // you will get same result on the top
    // functions download,getInfo = (id: string) => result json
  } catch (e) {
    console.log(e);
  }
})();

CLI

Upload files

node-annonfiles --upload file.txt

with keyaccess original from Annonfiles website

node-annonfiles --upload file.txt@{keyaccess}

Output

Wait for uploading file.txt
{
    "status": true,
    "data": {
        "file": {
            "url": {
                "full": "https://anonfiles.com/D9KbB411u2/file_txt",
                "short": "https://anonfiles.com/D9KbB411u2"
            },
            "metadata": {
                "id": "D9KbB411u2",
                "name": "file.txt",
                "size": {
                    "bytes": 5,
                    "readable": "5 B"
                }
            }
        }
    }
}
  • Make sure store the ID of any output for use it to get the direct download link.

Download files

You should use ID of the file you already uploaded it, I used D9KbB411u2 just for an example.

NOTE: you should use proxy for passing cloudflare detector.

Normal usage :

node-annonfiles --download D9KbB411u2

With proxy usage :

node-annonfiles --download D9KbB411u2@proxy

Output

Fetching direct link...
https://cdn-140.anonfiles.com/D9KbB411u2/d0db8fb0-1623874914/file.txt

Get Info Files

Use ID for get the info of files.

node-annonfiles --get D9KbB411u2

Output

Fetching File Metadata...
{
  "url": {
    "short": "https://anonfiles.com/D9KbB411u2",
    "full": "https://anonfiles.com/D9KbB411u2/file_txt"
  },
  "metadata": {
    "size": { "bytes": 5, "readable": "5 B" },
    "name": "file_txt",
    "id": "D9KbB411u2"
  }
}

License

Copyright (c) 2021 CA1R71 Licensed under the Apcahe 2.0 license.

node-annonfiles's People

Contributors

ca1r7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.