feat: add cookie support for discuz (#4033)

This commit is contained in:
junfengP
2020-02-19 23:04:16 +08:00
committed by GitHub
parent 7a68497814
commit da288c5f98
7 changed files with 90 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ const calculateValue = () => {
const bilibili_cookies = {};
const twitter_tokens = {};
const email_config = {};
const discuz_cookies = {};
for (const name in envs) {
if (name.startsWith('BILIBILI_COOKIE_')) {
@@ -17,6 +18,9 @@ const calculateValue = () => {
} else if (name.startsWith('EMAIL_CONFIG_')) {
const id = name.slice(13);
email_config[id] = envs[name];
} else if (name.startsWith('DISCUZ_COOKIE_')) {
const cid = name.slice(14);
discuz_cookies[cid] = envs[name];
}
}
@@ -117,6 +121,9 @@ const calculateValue = () => {
username: envs.NHENTAI_USERNAME,
password: envs.NHENTAI_PASSWORD,
},
discuz: {
cookies: discuz_cookies,
},
};
};
calculateValue();