GithubHelp home page GithubHelp logo

luludotdev / faceapp.js Goto Github PK

View Code? Open in Web Editor NEW
65.0 11.0 19.0 113 KB

JavaScript API wrapper for the FaceApp tool for Android and iOS

License: ISC License

JavaScript 100.00%
faceapp javascript-api-wrapper javascript photoshop

faceapp.js's Introduction

๐Ÿ˜Ž FaceApp.js

NPM version NPM downloads Build status Dependencies

JavaScript API wrapper for the FaceApp tool for Android and iOS. Licensed under ISC License.

โš ๏ธ Warning

faceapp.js is an unofficial reverse-engineering of the mobile clients and the servers they interact with. This means that it is subject to any of their limitations.
This includes their rate limits. I will not attempt to bypass this as that would break their terms of service, please stop asking โค.

USE AT YOUR OWN RISK.

Rate Limits

NOTE: These are just an estimation based on my own testing.
The FaceApp servers only accept 100 requests in a 10 minute window. Because process() uses two API calls, you can only use process() 50 times during that 10 minute window.

๐Ÿ’พ Installation

The package is on the NPM registry as faceapp. Simply install it with your NPM client of choice.

๐Ÿ”ง Usage

First, import the module:

const faceapp = require('faceapp')

The process() function takes two parameters:

  • path: string | file: Buffer - Path to the image file you would like to process. Or a Buffer object representing an image.
  • filterID: string - FaceApp Filter ID

๐Ÿ“ Example

// Import the module
const faceapp = require('faceapp')

// Process the image (filepath)
let image = await faceapp.process('path/to/image.png', 'smile_2')

// Process the image (buffer)
// First we have to get a buffer
let { body } = await superagent.get('http://example.com/image.png')
let image = await faceapp.process(body, 'hot')

โŒจ CLI

There is a CLI available. Install the package globally using npm i -g faceapp and then run faceapp to access the CLI.

๐Ÿ“œ Filter IDs

Known Filters:
no-filter smile smile_2 hot old
young female_2 female male pan
hitman hollywood heisenberg impression lion
goatee hipster bangs glasses wave
makeup

However, you can get an up-to-date list of all available filter IDs from the API directly using the listFilters function.

let filters = await faceapp.listFilters()
// Returns an array of Filter objects

let filters = await faceapp.listFilters(true)
// Returns an array filter ID strings

โค Thanks

faceapp.js's People

Contributors

albertoxamin avatar dshved avatar luludotdev avatar theessem avatar

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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

faceapp.js's Issues

Client error

We have created a small application for this effect of faceapp, we follow this project but when we connect the error
Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: POST https://node-03.faceapp.io/api/v2.6/photos resulted in a 429 Too Many Requests response: {"err":{"detail":"{'desc': 'Too many requests from your IP', 'code': 'too_many_requests'}"}} '

How to fix it

Can't use module.

I can't use the module, I tried using buffers, path and nothing!
Everytime that I try to use that, gives SyntaxError: Unexpected identifier! Thank you.

image

I removed the await and the image was saved, but the image can't be open.

const fs = require('fs');
let image = faceapp.process('./MASAHIRO.jpeg', 'smile_2')
fs.writeFile('face.jpeg', image, 'binary', function(err){
            if (err) throw err
            console.log('File saved.')
        })

Instant ratelimit after one request.

Not like you can do anything other than say fuck it to their ToS and shit at this point. They can be like Deezer if they really want to and start dishing out DMCA's instead of actually fixing shit on their end.

Ratelimits/API Info

I can't for the life of me find any info on what the ratelimits are OR any info on their api at all. Could you add a link to the README to any information?

command line

Hi, please make a command line app that every one can use it easy.

Update package

You need to update the package in npmjs.com, because the old version is installed from there.

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.