fix: pixiv login
This commit is contained in:
parent
f25d17aa3f
commit
ac80164099
|
|
@ -4,6 +4,7 @@ const wait = require('@/utils/wait');
|
|||
const FormData = require('form-data');
|
||||
const got = require('@/utils/got');
|
||||
const maskHeader = require('./constants').maskHeader;
|
||||
const md5 = require('@/utils/md5');
|
||||
|
||||
const pixivConfig = config.pixiv;
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ let token = null;
|
|||
const authorizationInfo = {
|
||||
client_id: 'MOBrBDS8blbauoSck0ZfDbtuzpyT',
|
||||
client_secret: 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj',
|
||||
hash_secret: '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c',
|
||||
username: pixivConfig.username,
|
||||
password: pixivConfig.password,
|
||||
};
|
||||
|
|
@ -29,11 +31,14 @@ async function getToken() {
|
|||
data.append(key, element);
|
||||
}
|
||||
}
|
||||
const localTime = new Date().toISOString();
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
url: 'https://oauth.secure.pixiv.net/auth/token',
|
||||
data: data,
|
||||
headers: {
|
||||
'X-Client-Time': localTime,
|
||||
'X-Client-Hash': md5(localTime + authorizationInfo.hash_secret),
|
||||
...maskHeader,
|
||||
...data.getHeaders(),
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue