This commit is contained in:
1 parent
931b670336
commit
162e049ada
3 files changed
+53
-43
No files matched your search
@@ -166,8 +166,14 @@ func downloadChapter(chapterPath string, url string) {
|
||||
})
|
||||
})
|
||||
|
||||
c.Visit(fmt.Sprint(url, "/images?is_prev=False¤t_page=1&reading_style=long_strip"))
|
||||
|
||||
// extract status code
|
||||
//c.OnResponse(func(r *colly.Response) {
|
||||
// log.Println("response received", r.StatusCode)
|
||||
//})
|
||||
c.OnError(func(r *colly.Response, err error) {
|
||||
log.Println("error:", r.StatusCode, err)
|
||||
})
|
||||
c.Visit(fmt.Sprint(url, "/images"))
|
||||
}
|
||||
|
||||
func compressToCbz(chapterPath string) {
|
||||
@@ -241,7 +247,7 @@ func downloadSeries(url string, downloadPath string, single float64) {
|
||||
chapterPath := fmt.Sprintf("%s/%s", seriesPath, c.Name)
|
||||
if _, err := os.Stat(seriesPath + "/" + c.Name + ".cbz"); os.IsNotExist(err) {
|
||||
log.Println("Downloading ", c.Name)
|
||||
downloadChapter(chapterPath, c.Link)
|
||||
downloadChapter(chapterPath, "https://weebcentral.com"+c.Link)
|
||||
//log.Println("Compressing", c.Name)
|
||||
compressToCbz(chapterPath)
|
||||
os.RemoveAll(chapterPath)
|
||||
@@ -281,9 +287,9 @@ func main() {
|
||||
if err != nil {
|
||||
fmt.Println("Could not find file")
|
||||
}
|
||||
paths := strings.Split(strings.TrimRight(string(dat), "\n"), "\n")
|
||||
paths := strings.SplitSeq(strings.TrimRight(string(dat), "\n"), "\n")
|
||||
|
||||
for _, p := range paths {
|
||||
for p := range paths {
|
||||
downloadSeries(p, *dlPathPtr, *chapterPtr)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
Reference in new issue
Block a user