From b2130f60d5e70315e19cc93c40459b9fb7e3c5ca Mon Sep 17 00:00:00 2001 From: nite Date: Sun, 20 Apr 2025 21:44:28 +1000 Subject: [PATCH] fix missing images --- downloader/bilinovel/bilinovel.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/downloader/bilinovel/bilinovel.go b/downloader/bilinovel/bilinovel.go index fd7cb75..89df2b8 100644 --- a/downloader/bilinovel/bilinovel.go +++ b/downloader/bilinovel/bilinovel.go @@ -427,15 +427,12 @@ func downloadChapterByPage(page, chapterIdx int, chapter *model.Chapter, outputP } } - fileName := filepath.Join(imgSavePath, fmt.Sprintf("%03v%s", i+1, path.Ext(imgUrl))) + fileName := filepath.Join(imgSavePath, fmt.Sprintf("%03v%s", len(chapter.ImageFullPaths)+1, path.Ext(imgUrl))) err = DownloadImg(imgUrl, filepath.Join(outputPath, fileName)) if err == nil { s.SetAttr("src", "../"+strings.TrimPrefix(fileName, "OEBPS/")) s.RemoveAttr("class") s.RemoveAttr("data-src") - if s.AttrOr("alt", "") == "" { - s.SetAttr("alt", fmt.Sprintf("image-%03d", i+1)) - } chapter.ImageFullPaths = append(chapter.ImageFullPaths, filepath.Join(outputPath, fileName)) chapter.ImageOEBPSPaths = append(chapter.ImageOEBPSPaths, strings.TrimPrefix(fileName, "OEBPS/")) }