Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .then(res => {
  2.         let token = res.headers['set-cookie'][0].substring(11, 93)
  3.  
  4.         var cookies = "\
  5.            __bon=MHwwfC02ODMzMTM5OTV8LTI4Njk5MTg3NzkwfDF8MXwxfDE=;\
  6.            csrf_token=" + token
  7.         var options = {
  8.             method: 'POST',
  9.             url: 'https://accounts.spotify.com/api/login',
  10.             json: true,
  11.             headers: {
  12.                 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0',
  13.                 'Cookie': cookies
  14.             },
  15.             jar: cookieJar,
  16.             form: { remember: 'true', username: email, password: password, csrf_token: token }
  17.  
  18.         }
  19.         request(options, function(err, res, body) {
  20.             return body; //Como envio isso
  21.         })
  22.  
  23.     }).then(body => {
  24.         //para isso
  25.         console.log(body);
  26.     })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement