Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最近发现自动上传到图床的图片大小都不正确,无法正常显示怎么排查? #129

Open
KaimingWan opened this issue Oct 30, 2022 · 4 comments

Comments

@KaimingWan
Copy link

命令执行过程没有任何报错,OSS和COS都试了,图片都好像只上传了部分,只有300多K。感觉是语雀下载的图片不完整,怎么办?
image

@LetTTGACO
Copy link
Collaborator

方便出问题的语雀文章链接发过来我试一下吗?

@KaimingWan
Copy link
Author

应该是下载图片处理有问题了。我自己重新写了个工具已经解决了。感谢楼主项目提供的思路。

@furacas
Copy link
Contributor

furacas commented Nov 10, 2022

我遇到了同样的问题,我这边排查之后发现是因为最近语雀图片cdn的反爬策略加强了吧,以前项目里面的superagent请求没设置User-Agent的时候会直接被403掉。
我看现在的master分支上已经设置上了,可以更新一下版本试试看

await superagent
.get(yuqueImgUrl)
.set('User-Agent', 'Mozilla/5.0')
.buffer(true)
.parse(res => {
const buffer = [];
res.on('data', chunk => {
buffer.push(chunk);
});
res.on('end', () => {
const data = Buffer.concat(buffer);
resolve(data);
});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants