Files
RSSHub/lib/v2/yxdown/utils.js
linbuxiao 57b466908f fix: yxdown missing cookies (#10719)
* fix: yxdown missing cookies

* refactor: migrate to v2

* fix: cookie parsing

* docs: fix attr
2022-09-06 19:38:52 +08:00

18 lines
354 B
JavaScript

const got = require('@/utils/got');
const rootUrl = 'http://www.yxdown.com';
const getCookie = async () => {
const cookieResponse = await got(rootUrl);
const cookieRegx = /(?<=.cookie=").*(?=; path)/g;
const cookieStr = cookieResponse.data.match(cookieRegx)[0];
return cookieStr;
};
module.exports = {
rootUrl,
getCookie,
};