用http替换一下https获取favicon

This commit is contained in:
luchenqun 2017-03-09 13:07:01 +08:00
parent dce319f283
commit 4bb164dafe
1 changed files with 6 additions and 0 deletions

View File

@ -959,6 +959,12 @@ api.getFaviconByTimer = function() {
busy = false
});
} else {
// 尝试用http试一下手动抓取成功后会被缓存起来,直接使用[http]即可访问.请勿批量使用[https]
if (faviconState == 1) {
if (url.startsWith("https")) {
url = "http" + url.substring(5);
}
}
var faviconUrl = "http://g.soz.im/" + url;
download(faviconUrl).then(data => {
fs.writeFileSync(faviconPath, data);