npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

twitch-account

v1.1.3

Published

Create a twitch account

Downloads

9

Readme

Twitch Account Generator

Npm package version

Install

yarn add twitch-account

Sample

  import {
    AntiCaptchaService,
    MailService,
    TwitchService,
    GenerateUser,
    ParseTokenCaptcha,
    TwitchInvalidUsernameException,
  } from './twitch-account';

  // MAIL DOMAIN
  const DOMAIN = 'chitthi.in';

  // TWITCH CLIENT ID
  const CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';

  // ARKOSE FUN CATCHA KEY
  const CAPTCHA_KEY = 'E5554D43-23CC-1982-971D-6A2262A2CA24';

  const PROXY = {
    host: '<YOUR_HOST>',
    port: 443,
    auth: {
      username: '<YOUR_USERNAME>',
      password: '<YOUR_PASSWORD>',
    },
    protocol: 'http' || 'sock',
  };

  const USER_AGENT = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Mobile Safari/537.36' 

  // Setup Service
  const MailClient = new MailService({ domain: DOMAIN, proxy: PROXY });
  const TwitchClient = new TwitchService({
    clientId: CLIENT_ID,
    userAgent: USER_AGENT,
    proxy: PROXY,
  });
  const AntiCaptcha = new AntiCaptchaService({
    apiKey: '<YOUR_ANTICAPTCHA_API_KEY>',
    proxy: PROXY,
    userAgent: USER_AGENT,
  });

  // Load default cookie from twitch
  await TwitchClient.CurlCookie();

  // We use https://tempmail.plus/en/#! to parse email
  // Some domain is available
  // You have tool to use your self email provider
  // You can pass too your self username and password
  const UserData = GenerateUser({
    email: {
      domain: MailClient.domain,
    },
  });

  // Verify if username generate is free
  if (!(await TwitchClient.isUserNameValid(UserData.username))) {
    throw new TwitchInvalidUsernameException(UserData.username);
  }

  // Solve Captcha
  const UnParsedCaptcha = await AntiCaptcha.resolve({
    url: TwitchService.SIGN_UP_URL,
    key: CAPTCHA_KEY,
  });

  // Parse Captcha
  const ParsedCaptcha = ParseTokenCaptcha(UnParsedCaptcha);

  // Generate payload for create user request
  const UserPayload = TwitchClient.generatePayload({
    user: UserData,
    token: ParsedCaptcha,
  });

  // Request create user
  // Return an object with userId and accessToken when is successful
  const User = await TwitchClient.create(UserPayload);

  // Get last mail 
  // 2nd parameter : Max retry
  // 3rd parameter : Retry interval
  const MailContent = await MailClient.getContentLastMailWithRetry(
    UserData.id,
    20,
  );

  // Get opaque id from mail content (version text)
  const OpaqueID = TwitchClient.getOpaqueIdFromMailVerification(MailContent);

  // Request to verify the email
  await TwitchClient.verifyMail(OpaqueID);

TroubleShooting

Exception TwitchCaptchaInvalidException is frequent if proxy is fraud detected by the KYC service (Arkose)

TODO

  • Scrap
    • Client ID
    • FunCapcha Token

Licence

MIT