修复五位字符的封面名称问题
This commit is contained in:
parent
2d610975e8
commit
ec33be03ac
@ -111,6 +111,15 @@ func (c *Crawler) fetchCoverImg(code string) error {
|
||||
imgUrl := strings.ReplaceAll(c.config.GetString("crawler.url"), `*`, code)
|
||||
suffix := filepath.Ext(imgUrl)
|
||||
nameSlice := strings.Split(code, "00")
|
||||
|
||||
if len(nameSlice) < 2 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(nameSlice[0]) > 4 {
|
||||
nameSlice[0] = nameSlice[0][1:]
|
||||
}
|
||||
|
||||
fileName := strings.Join([]string{
|
||||
c.outputPath,
|
||||
string(os.PathSeparator),
|
||||
|
Loading…
Reference in New Issue
Block a user