mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🐛 Unable to download online video https://github.com/siyuan-note/siyuan/issues/14155
This commit is contained in:
parent
8019fd6a6e
commit
ff1e29424d
1 changed files with 4 additions and 6 deletions
|
|
@ -182,19 +182,17 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
|
||||||
request.SetHeader("Referer", originalURL) // 改进浏览器剪藏扩展转换本地图片成功率 https://github.com/siyuan-note/siyuan/issues/7464
|
request.SetHeader("Referer", originalURL) // 改进浏览器剪藏扩展转换本地图片成功率 https://github.com/siyuan-note/siyuan/issues/7464
|
||||||
}
|
}
|
||||||
resp, reqErr := request.Get(u)
|
resp, reqErr := request.Get(u)
|
||||||
|
if nil != reqErr {
|
||||||
|
logging.LogErrorf("download network asset [%s] failed: %s", u, reqErr)
|
||||||
|
continue
|
||||||
|
}
|
||||||
if http.StatusForbidden == resp.StatusCode || http.StatusUnauthorized == resp.StatusCode {
|
if http.StatusForbidden == resp.StatusCode || http.StatusUnauthorized == resp.StatusCode {
|
||||||
forbiddenCount++
|
forbiddenCount++
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(strings.ToLower(resp.GetContentType()), "text/html") {
|
if strings.Contains(strings.ToLower(resp.GetContentType()), "text/html") {
|
||||||
// 忽略超链接网页 `Convert network assets to local` no longer process webpage https://github.com/siyuan-note/siyuan/issues/9965
|
// 忽略超链接网页 `Convert network assets to local` no longer process webpage https://github.com/siyuan-note/siyuan/issues/9965
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if nil != reqErr {
|
|
||||||
logging.LogErrorf("download network asset [%s] failed: %s", u, reqErr)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if 200 != resp.StatusCode {
|
if 200 != resp.StatusCode {
|
||||||
logging.LogErrorf("download network asset [%s] failed: %d", u, resp.StatusCode)
|
logging.LogErrorf("download network asset [%s] failed: %d", u, resp.StatusCode)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue