diff --git a/lib/index.js b/lib/index.js index 0dc461e..7ec60b6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -99,11 +99,11 @@ Lastfm.prototype.getSessionKey = function(callback) { var parser = new xml2js.Parser(); parser.parseString(body, function(err, result) { var ret = { - success: result['@'].status == 'ok' + success: result['lfm']['$'].status == 'ok' }; if(ret.success) { - ret.session_key = result.session.key; - lastfmObj.session_key = result.session.key; + ret.session_key = result['lfm']['session'][0]['key'][0]; + lastfmObj.session_key = result['lfm']['session'][0]['key'][0]; } else ret.error = result.error['#']; if(typeof callback == 'function') { @@ -415,4 +415,4 @@ function md5(string) { return crypto.createHash('md5').update(string, 'utf8').digest("hex"); } -module.exports = Lastfm; +module.exports = Lastfm; \ No newline at end of file