feat: 为豆瓣想看增加Cookie配置项 (#9110)

This commit is contained in:
Rick Lee
2022-02-24 23:50:12 +08:00
committed by GitHub
parent 72724419c2
commit f1e7c90c3e
4 changed files with 10 additions and 1 deletions
+2
View File
@@ -604,3 +604,5 @@ See docs of the specified route and `lib/config.js` for detailed information.
- Google Fonts: [API key application](https://developers.google.com/fonts/docs/developer_api#a_quick_example)
- `GOOGLE_FONTS_API_KEY`: API key
- douban
- `DOUBAN_COOKIE`: Cookie of douban user
+3
View File
@@ -730,3 +730,6 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
- Google Fonts:[申请地址](https://developers.google.com/fonts/docs/developer_api#a_quick_example)
- `GOOGLE_FONTS_API_KEY`: API key
- 豆瓣想看
- `DOUBAN_COOKIE`: 豆瓣登陆后的 Cookie 值
+3
View File
@@ -224,6 +224,9 @@ const calculateValue = () => {
password: envs.IG_PASSWORD,
proxy: envs.IG_PROXY,
},
douban: {
cookie: envs.DOUBAN_COOKIE,
},
};
};
calculateValue();
+2 -1
View File
@@ -2,7 +2,7 @@ const querystring = require('querystring');
const cheerio = require('cheerio');
const got = require('@/utils/got');
const torrent = require('@/utils/torrent');
const config = require('@/config').value;
module.exports = async (ctx) => {
const userid = ctx.params.userid;
const routeParams = querystring.parse(ctx.params.routeParams);
@@ -25,6 +25,7 @@ module.exports = async (ctx) => {
url,
headers: {
Referer: url,
Cookie: config.douban.cookie || '',
},
}).then((response) => {
const data = response.data;