Skip to content

Commit

Permalink
changed email to user
Browse files Browse the repository at this point in the history
  • Loading branch information
INSANITY\Inrix authored and INSANITY\Inrix committed Dec 12, 2017
1 parent a037e8f commit 186fbc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ checkAuth().then(constructCookie).then(parseKey).then(logEpisodeCount).then(find

function checkAuth(forced) {
return new Promise((resolve, reject) => {
if (forced || !settings.cookies.ips4_IPSSessionFront && (!settings.email || !settings.password)) {
if (forced || !settings.cookies.ips4_IPSSessionFront && (!settings.user || !settings.password)) {
console.log('> Please enter your login details:');
prompt.start();
prompt.get([{name: "Email", required: true}, {name: "Password", required: true, hidden: true, replace: '*'}], function (err, result) {
settings.email = result.Email
prompt.get([{name: "Email/Username", required: true}, {name: "Password", required: true, hidden: true, replace: '*'}], function (err, result) {
settings.user = result['Email/Username']
settings.password = result.Password
console.log('');
getSession().then(doLogin).then(resolve)
});
} else if((!settings.cookies.ips4_IPSSessionFront && (settings.email || settings.password))) {
} else if((!settings.cookies.ips4_IPSSessionFront && (settings.user || settings.password))) {
getSession().then(doLogin).then(resolve)
} else {
console.log('> Using saved login data');
Expand Down Expand Up @@ -91,15 +91,15 @@ function getSession() {
}

function doLogin() {
console.log("> Logging in as", settings.email)
console.log("> Logging in as", settings.user)
return new Promise((resolve, reject) => {
req.post({
headers: {
Cookie: settings.cookies.ips4_IPSSessionFront,
'content-type': 'application/x-www-form-urlencoded'
},
url: 'https://linustechtips.com/main/login/',
body: "login__standard_submitted=1&csrfKey=" + settings.csrfKey + "&auth=" + settings.email + "&password=" + settings.password + "&remember_me=1&remember_me_checkbox=1&signin_anonymous=0"
body: "login__standard_submitted=1&csrfKey=" + settings.csrfKey + "&auth=" + settings.user + "&password=" + settings.password + "&remember_me=1&remember_me_checkbox=1&signin_anonymous=0"
}, function (error, resp, body) {
if (resp.headers['set-cookie']) {
console.log('Logged In!\n');
Expand Down
2 changes: 1 addition & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ips4_member_id": ""
},
"video_res": 1080,
"email": "",
"user": "",
"password": "",
"csrfKey": ""
}

0 comments on commit 186fbc5

Please sign in to comment.