mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 08:10:32 +08:00
* fix: yxdown missing cookies * refactor: migrate to v2 * fix: cookie parsing * docs: fix attr
18 lines
354 B
JavaScript
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,
|
|
};
|