How to obtain the needed .env variable?
sonicjhon1 opened this issue · 1 comments
sonicjhon1 commented
As stated in the title, is there any guide on how to obtain:
NEXT_PUBLIC_IG_DEVICE_STRING
NEXT_PUBLIC_IG_DEVICE_ID
NEXT_PUBLIC_IG_UUID
NEXT_PUBLIC_IG_PHONE_ID
NEXT_PUBLIC_IG_ADID
NEXT_PUBLIC_IG_BUILD
yasinatesim commented
The project uses to dilame/instagram-private-api. When using this library, if you want you can use the below code;
ig.state.generateDevice(process.env.IG_USERNAME);
Example is here.
I didn't want use it because, every time I refresh the page it chooses a different device with generateDevice and Instagram blocked my authenticated user so I didn't use to generateDevice function and I defined it as contants;
public generateDevice(seed: string): void {
const chance = new Chance(seed);
this.deviceString = chance.pickone(devices);
const id = chance.string({
pool: 'abcdef0123456789',
length: 16,
});
this.deviceId = `android-${id}`;
this.uuid = chance.guid();
this.phoneId = chance.guid();
this.adid = chance.guid();
this.build = chance.pickone(builds);
}
Can you please check generateDevice function in dilame/private-instagram-api package?