Open ozkcs opened 3 years ago
otw
can i fix it?
\node-insta-web-api\lib\index.js change code:
async _getSharedData(url = this.baseUrl) {
try{
var getText = await this.requestNodeFetch.getText(url, this.headers);
if( getText.res != undefined ){
// 如果被风控
var res_text = JSON.parse(getText.res.text)
var challenge = await this.requestNodeFetch.post("https://www.instagram.com/challenge/", "choice=0&next=%2Faccounts%2Fedit%2F", this.headers)
console.log( challenge )
console.log("challenge is coming... and pass")
// 重新获取
getText = await this.requestNodeFetch.getText(url, this.headers);
}
const _sharedData = helpers.getString('<script type="text/javascript">window._sharedData =', '};</script>', getText);
const resultJsonStringData = `${_sharedData[1]}}`;
const resultJson = JSON.parse(resultJsonStringData);
return resultJson;
}catch(e){
throw new Error(e)
}
}
make a feature to bypass instagram challenge login attempt