diff --git a/docs/en/install/README.md b/docs/en/install/README.md index c6f7be0fa..c28942119 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -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 \ No newline at end of file diff --git a/docs/install/README.md b/docs/install/README.md index d18ad38e1..497de10e7 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -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 值 diff --git a/lib/config.js b/lib/config.js index 4c460b9cc..2157eaf25 100644 --- a/lib/config.js +++ b/lib/config.js @@ -224,6 +224,9 @@ const calculateValue = () => { password: envs.IG_PASSWORD, proxy: envs.IG_PROXY, }, + douban: { + cookie: envs.DOUBAN_COOKIE, + }, }; }; calculateValue(); diff --git a/lib/v2/douban/people/wish.js b/lib/v2/douban/people/wish.js index 032a7827a..15e33a226 100644 --- a/lib/v2/douban/people/wish.js +++ b/lib/v2/douban/people/wish.js @@ -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;