feat: 为豆瓣想看增加Cookie配置项 (#9110)
This commit is contained in:
@@ -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
|
||||
@@ -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 值
|
||||
|
||||
@@ -224,6 +224,9 @@ const calculateValue = () => {
|
||||
password: envs.IG_PASSWORD,
|
||||
proxy: envs.IG_PROXY,
|
||||
},
|
||||
douban: {
|
||||
cookie: envs.DOUBAN_COOKIE,
|
||||
},
|
||||
};
|
||||
};
|
||||
calculateValue();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user