Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .then(res => {
- let token = res.headers['set-cookie'][0].substring(11, 93)
- var cookies = "\
- __bon=MHwwfC02ODMzMTM5OTV8LTI4Njk5MTg3NzkwfDF8MXwxfDE=;\
- csrf_token=" + token
- var options = {
- method: 'POST',
- url: 'https://accounts.spotify.com/api/login',
- json: true,
- headers: {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0',
- 'Cookie': cookies
- },
- jar: cookieJar,
- form: { remember: 'true', username: email, password: password, csrf_token: token }
- }
- request(options, function(err, res, body) {
- return body; //Como envio isso
- })
- }).then(body => {
- //para isso
- console.log(body);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement