Skip to content

Instantly share code, notes, and snippets.

@jamesandariese
Forked from vrumger/google.js
Last active November 20, 2023 15:58
Show Gist options
  • Save jamesandariese/f9c73f0a6db506fadc8c02ebbe11ab68 to your computer and use it in GitHub Desktop.
Save jamesandariese/f9c73f0a6db506fadc8c02ebbe11ab68 to your computer and use it in GitHub Desktop.
Create a google account and go to youtube with puppeteer.
const puppeteer = require('puppeteer');
const uuid = require('uuid');
const sleep = ms => new Promise(r => setTimeout(r, ms));
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
const id = uuid.v4();
const [firstName, lastName] = id.split('-');
const username = id.slice(0, 30).replace(/-/g, '.');
const password = `${id}123!`;
await page.goto('https://accounts.google.com/signin/v2/identifier?hl=en&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Fhl%3Den%26next%3D%252F%26app%3Ddesktop%26action_handle_signin%3Dtrue&passive=true&service=youtube&uilel=3&flowName=GlifWebSignIn&flowEntry=ServiceLogin');
// Click "Create an account"
await Promise.all([
page.waitForNavigation(),
page.$x("//div[contains(., \"Create account\") and @role=\"button\"]").click()
]);
// Wait for page to load
await sleep(1000);
// Click "Create a Gmail account instead"
await page.tap('.uBOgn');
await page.type('#firstName', firstName);
await page.type('#lastName', lastName);
await page.type('#username', username);
await page.type('input[type="password"][name="Passwd"]', password);
await page.type('input[type="password"][name="ConfirmPasswd"]', password);
// Click "Next"
await page.tap('#accountDetailsNext');
})();
@lulitha
Copy link

lulitha commented May 1, 2021

I have tired. I there any other way, please?

@YacineAi
Copy link

it's hard you know
there is phone verification and if you face captcha that is bad
then google only let you verificate 10 accounts or less withe same number

@oyi77
Copy link

oyi77 commented Aug 8, 2021

use otpsim.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment