Giter Site home page Giter Site logo

salamoonder's Introduction

Salamoonder API Wrapper

Usage

import Salamoonder, { TwitchIntegrity } from "salamoonder";
const api = new Salamoonder(process.env.SALAMOONDER_API_KEY);

try {
  api.generateIntegrity().then((response: TwitchIntegrity) => {
    console.log(response.token);
  });
} catch (error) {
  console.log(error);
}

Disclaimer

By default you are supporting me through the usage of my app id. This can be disabled by simply adding false as a second parameter when initiating the salamoonder class.

const api = new Salamoonder(process.env.SALAMOONDER_API_KEY, false);

API Calls

getBalance()

Example

api.getBalance().then((bal: number) => {
  console.log(bal);
});

Returns

number;

solveCaptcha()

Solves a kasada captcha for a given site.

Parameters

  • site: Site to solve the captcha for

Example (for Twitch)

api.solveCaptcha(TaskPjsFile.TWITCH).then((response: getTaskResult) => {
  console.log(response);
});

Returns

{
  errorId: number;
  solution: {
    type: string;
    "user-agent": string;
    "x-kpsdk-cd": string;
    "x-kpsdk-cr": string;
    "x-kpsdk-ct": string;
    "x-kpsdk-r": string;
    "x-kpsdk-st": string;
  };
  status: "ready" | "pending";
}

registerTwitchAccount()

Registers a new Twitch account.

Parameters

  • email: Email address for the account

Example

api.registerTwitchAccount("[email protected]").then((response: getTaskResult) => {
  console.log(response);
});

Returns

{
  errorId: number;
  solution: {
    type: string;
    access_token: string;
    password: string;
    username: string;
  }
  status: "ready" | "pending";
}

checkTwitchIntegrity()

Checks the integrity of a Integrity Token.

Parameters

  • token: Integrity Token to check

Example

api.checkTwitchIntegrity("token").then((response: getTaskResult) => {
  console.log(response);
});

Returns

{
  errorId: number;
  solution: {
    type: string;
    client_id: string;
    client_ip: string;
    device_id: string;
    exp: string;
    iat: string;
    is_bad_bot: string;
    iss: string;
    nbf: string;
    user_id: string;
  }
  status: "ready" | "pending";
}

scrapeTwitch()

Scrapes Twitch for meta data

Example

api.scrapeTwitch().then((response: TwitchScraperSolution) => {
  console.log(response);
});

Returns

{
  errorId: number;
  solution: {
    biography: string;
    profile_picture: string;
    username: string;
  }
  status: "ready" | "pending";
}

generateIntegrity()

Generates an Integrity token.
Both Salamoonder versions require a proxy with the format user:password@host:port

Generation methods

API_Public

Generation via Salamoonder, with token

API_Local

Generation via Salamoonder, no token

Self

Generation locally, optionally token & proxy

Passport

Generate Passport Integrity Tokens, optionally proxy

Parameters

  • type: Generation Method
  • data: Data for each method

Example

api
  .generateIntegrity(IntegrityGenerateType.API_PUBLIC, {
    proxy: "test:123@test:3000",
    access_token: "jneapaw1pr0ob83fievedqpi1jqzb4",
  })
  .then((response: TwitchIntegrity) => {
    console.log(response);
  });

Returns

{
  clientId: string;
  token: string;
  sessionId?: string;
  userAgent: string;
  deviceId: string;
}

salamoonder's People

Contributors

kappador avatar

Stargazers

exze avatar  avatar  avatar rodi avatar Alex Sidorenko avatar

Watchers

 avatar

salamoonder's Issues

I have a some problems with the user creation on Twitch

When I tried generate a new user on Twitch, with a custom username, the library response me that the username is use already but is not true, this is a problem and I think that the current validation is with 404 status but Twitch never will response with status 404, please I need an update to create users because is imposible with the current configuration.

When I try to create custom users, all of them are always answered by the API that are already in use. @Kappador

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.