Twitch Account Generator
Install
yarn add twitch-account
Sample
import {
AntiCaptchaService,
MailService,
TwitchService,
GenerateUser,
ParseTokenCaptcha,
TwitchInvalidUsernameException,
} from './twitch-account';
const DOMAIN = 'chitthi.in';
const CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';
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'
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,
});
await TwitchClient.CurlCookie();
const UserData = GenerateUser({
email: {
domain: MailClient.domain,
},
});
if (!(await TwitchClient.isUserNameValid(UserData.username))) {
throw new TwitchInvalidUsernameException(UserData.username);
}
const UnParsedCaptcha = await AntiCaptcha.resolve({
url: TwitchService.SIGN_UP_URL,
key: CAPTCHA_KEY,
});
const ParsedCaptcha = ParseTokenCaptcha(UnParsedCaptcha);
const UserPayload = TwitchClient.generatePayload({
user: UserData,
token: ParsedCaptcha,
});
const User = await TwitchClient.create(UserPayload);
const MailContent = await MailClient.getContentLastMailWithRetry(
UserData.id,
20,
);
const OpaqueID = TwitchClient.getOpaqueIdFromMailVerification(MailContent);
await TwitchClient.verifyMail(OpaqueID);
TroubleShooting
Exception TwitchCaptchaInvalidException
is frequent if proxy is fraud detected by the KYC service (Arkose)
TODO
Licence
MIT