How to use the instagram-private-api.V1.CookieMemoryStorage function in instagram-private-api

To help you get started, we’ve selected a few instagram-private-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathdroid / igdm-cli / src / index.js View on Github external
if (!argv.username) {
    const { username } = await inquirer.prompt({
      name: "username",
      message: "Instagram Username: "
    });
    _username = username;
  } else {
    _username = argv.username;
  }

  device = new Client.Device(`instagram.com/${_username}`);
  storage = argv.persist
    ? new Client.CookieFileStorage(
        __dirname + ("/ig-cookie." + _username + ".json")
      )
    : new Client.CookieMemoryStorage();

  let _password;
  if (!argv.password) {
    const { password } = await inquirer.prompt({
      name: "password",
      message: "Instagram password: ",
      type: "password"
    });
    _password = password;
  } else {
    _password = argv.password;
  }

  const loginSpinner = ora(`Logging in as ${_username}`).start();

  let session;
github igdmapps / igdm / main / utils.js View on Github external
const getCookieStorage = (filePath) => {
  let storage;
  let username;

  if (canUseFileStorage()) {
    if (!filePath && (username = guessUsername())) {
      filePath = `${username}.json`
    }

    if (filePath) storage = new Client.CookieFileStorage(`${buildAndGetStoragePath()}/${filePath}`);
  } else {
    storage = new Client.CookieMemoryStorage();
  }

  return storage;
}