Compare commits
2 commits
b75edb2136
...
c263fd9ccd
Author | SHA1 | Date | |
---|---|---|---|
c263fd9ccd | |||
fd6ce2a51e |
2 changed files with 4 additions and 5 deletions
|
@ -429,7 +429,7 @@ func (jncApi *Api) GetLibrarySeries() (seriesList []SerieAugmented, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (jncApi *Api) Download(link string, targetDir string) (name string, err error) {
|
func (jncApi *Api) Download(link string, targetDir string) (name string, err error) {
|
||||||
fmt.Printf("Downloading %s...", link)
|
fmt.Printf("Downloading %s...\n", link)
|
||||||
res, err := http.Get(link)
|
res, err := http.Get(link)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
7
main.go
7
main.go
|
@ -369,7 +369,7 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
||||||
|
|
||||||
zipPath := basePath + volume.Info.Title + " Chapter " + chap.chDisplay + ".cbz"
|
zipPath := basePath + volume.Info.Title + " Chapter " + chap.chDisplay + ".cbz"
|
||||||
|
|
||||||
if _, err = os.Stat(zipPath); err != nil {
|
if _, err = os.Stat(zipPath); err == nil {
|
||||||
err := os.Remove(zipPath)
|
err := os.Remove(zipPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -822,7 +822,7 @@ func GenerateMangaChapterList(navigation FileWrapper) *list.List {
|
||||||
label := navChapter.FindElement("./navLabel/text").Text()
|
label := navChapter.FindElement("./navLabel/text").Text()
|
||||||
page := navChapter.FindElement("./content")
|
page := navChapter.FindElement("./content")
|
||||||
|
|
||||||
regex := "(?:Chapter|Episode) ([0-9]*)"
|
regex := "(?:Chapter|Episode) ([0-9IVXLCDM]*)"
|
||||||
match, _ := regexp.MatchString(regex, label)
|
match, _ := regexp.MatchString(regex, label)
|
||||||
|
|
||||||
if match {
|
if match {
|
||||||
|
@ -830,14 +830,13 @@ func GenerateMangaChapterList(navigation FileWrapper) *list.List {
|
||||||
num := r.FindStringSubmatch(label)[1]
|
num := r.FindStringSubmatch(label)[1]
|
||||||
parse, _ := strconv.ParseInt(num, 10, 8)
|
parse, _ := strconv.ParseInt(num, 10, 8)
|
||||||
if int8(parse) == 0 {
|
if int8(parse) == 0 {
|
||||||
fmt.Printf("Unlikely Chapter Number Detected (0): %s/n", num)
|
fmt.Printf("Unlikely Chapter Number Detected (0): '%s'\n", num)
|
||||||
fmt.Println("Attempting Roman Numerals")
|
fmt.Println("Attempting Roman Numerals")
|
||||||
lastMainChapter = int8(romanToInt(num))
|
lastMainChapter = int8(romanToInt(num))
|
||||||
} else {
|
} else {
|
||||||
lastMainChapter = int8(parse)
|
lastMainChapter = int8(parse)
|
||||||
}
|
}
|
||||||
subChapter = int8(0)
|
subChapter = int8(0)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if lastMainChapter == -1 {
|
if lastMainChapter == -1 {
|
||||||
subChapter -= 1
|
subChapter -= 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue