Trying to fix #59 by adding a referer to the header. Seems to fix it but need to be throughfully tested..

This commit is contained in:
Godzil 2018-03-29 20:40:17 +01:00
parent bf8e1fe80f
commit 090c7e4789

View File

@ -9,8 +9,10 @@ let isPremium = false;
const defaultHeaders: request.Headers =
{
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0',
'Connection': 'keep-alive'
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64; x64; rv:58.0) Gecko/20100101 Firefox/58.0',
// Mozilla/5.0 (Windows NT 6.2; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0',
'Connection': 'keep-alive',
'Referer': 'https://www.crunchyroll.com/login'
};
/**
@ -99,9 +101,9 @@ function authenticate(config: IConfig, done: (err: Error) => void)
headers: defaultHeaders,
form:
{
'login_form[redirect_url]': '/',
'login_form[name]': config.user,
'login_form[password]': config.pass,
'login_form[redirect_url]': '/',
'login_form[_token]': token
},
jar: true,