How to use the instagram-private-api.V1.CONSTANTS 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 igdmapps / igdm / main / instagram.js View on Github external
return new Promise((resolve, reject) => {
    const device = utils.getDevice(username);
    const storage = utils.getCookieStorage(`${username}.json`);
    const session = new Client.Session(device, storage);
    const request = new Client.Request(session);
    request.setMethod('POST')
              .setUrl(Client.CONSTANTS.API_ENDPOINT + "accounts/two_factor_login/")
              .generateUUID()
              .setData({
                  username: username,
                  verification_code: code,
                  two_factor_identifier: twoFactorIdentifier,
                  trust_this_device: trustThisDevice,
                  verification_method: verificationMethod,
              })
              .signPayload()
              .send()
              .then(() => session.loginFlow())
              .then(() => resolve(session))
              .catch(reject)
  })
}