How to use the instagram-private-api.V1.Request 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 terkelg / ramme / src / common / api / user.js View on Github external
const getActivity = async (cursor = null) => {
  if (user) {
    try {
      let session = await loadSession(user)
      // let account = await session.getAccount()
      return new api.Request(session)
        .setMethod('GET')
        .setResource('news')
        .send()
        .then(function (json) {
          console.log(inspect(json))
          return inspect(json)
        })
    } catch (e) {
      return false
    }
  }
}
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)
  })