Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

pogo.GetProfile throws exception after successful login #266

Open hjw3001 opened 7 years ago

hjw3001 commented 7 years ago

` 'use strict';

var PokemonGO = require('./poke.io.js'); var pogo = new PokemonGO.Pokeio();

var location = { type: 'coords', coords: { latitude: -34.60537813731424, longitude: -58.366670608520508 } };

var username = 'user'; var password = 'password'; var provider = 'ptc';

pogo.init(username, password, location, provider, function(err) { if (err) throw err;

console.log('Current location: ' + pogo.playerInfo.locationName);
console.log('lat/long/alt: : ' + pogo.playerInfo.latitude + ' ' + pogo.playerInfo.longitude + ' ' + pogo.playerInfo.altitude);

pogo.GetProfile(function(err, profile) {
    if (err) throw err;

    console.log('Username: ' + profile.username);

    var currency = {};
    for (var i in profile.currency){
        var type = profile.currency[i].type;
        var amount = profile.currency[i].amount;
        if (!amount){
            amount = 0;
        }
        currency[type] = amount;
    }
    console.log('Stardust: ' + currency['STARDUST']);
});

pogo.GetInventory(function(err, inventory){
    if (err) throw err;
    var cleanedInventory = { player_stats: null, eggs : [], pokemon: [], items: [] };
    console.log(inventory);
    callback(cleanedInventory);
});

});`

It looks like my user is successful in logging in, an exception keeps occuring on:

Pokeio.GetProfile

I'm using a new PTC account, one that so far I've just used for PokeSensor. This user hasn't caught any Pokemon. Is there some more steps I need to do with that user for GetProfile to work?

`[i] Logging with user: ... [i] Session token: ... [i] Received PTC access token! [i] Received API Endpoint: https://null/rpc Current location: .... lat/long/alt: : .... /Users/henrywagner/Developer/node/Pokemon-GO-node-api/demo.js:25 if (err) throw err; ^

Error: Error at Request._callback (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/poke.io.js:266:27) at self.callback (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/node_modules/request/request.js:188:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Request.onRequestError (/Users/henrywagner/Developer/node/Pokemon-GO-node-api/node_modules/request/request.js:884:8) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) `

bbuhler commented 7 years ago

I have the same issue.

Error: getaddrinfo EAI_AGAIN null:443

Seems like there is something wrong with the API Endpoint which gets also logged as "https://null/rpc".

There are some more issues regarding that:

In their case the server was down. But this doesn't seem to be the case here.

billyriantono commented 6 years ago

We need to update all things related with the Pokemon Go changes in order to make this library works again :)