Replies: 4 comments 2 replies
-
|
好主意🥳目前爬虫的逻辑可以单独在Nodejs中运行,加个调用的接口就好了,有空我想想怎么做 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@geekrainy 现在可以在 cli 中运行了🥳🥳 beta 版下载 weibo-archiver-cli 在 cli/readme 中作了参数说明,web 页面也兼容了导入 cli 的数据 |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
不知道是是否是我的版本问题,使用cli提取,需要修改下面这个函数: async function fetchRangePosts(uid, start, end, page = 1, hasRepost = true) {
// 确保 dayStart 和 dayEnd 函数在此处可用 我添加的
function dayStart(date) {
const d = new Date(date);
d.setHours(0, 0, 0, 0);
return d.getTime();
}
function dayEnd(date) {
const d = new Date(date);
d.setHours(23, 59, 59, 999);
return d.getTime();
}
// 作者代码
const { data } = await weiFetch(`/statuses/searchProfile`, {
params: {
uid,
page,
starttime: dayStart(start) / 1e3,
endtime: dayEnd(end) / 1e3,
hasori: 1,
// 是否包含原创
hasret: hasRepost ? 1 : 0,
// 是否包含转发
hastext: 1,
// 是否包含文字
haspic: 1,
// 是否包含图片
hasvideo: 1,
// 是否包含视频
hasmusic: 1
// 是否包含音乐
}
});
return data;
}作者代码会提示 |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
实际使用 cli 版本最大的困难在于 cookie 太容易过期了,我之前配置 CI 上跑,基本一周内就要重新拿 cookie,悲~ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
感谢作者提供脚本!
我的想法是否可以提供纯 cli 接口以及配置文件,可以在命令行中运行备份。这样的话我就可以配置一个 CI 来定时导出我的微博数据了。:)
Beta Was this translation helpful? Give feedback.
All reactions