Skip to content

Commit

Permalink
trying to fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
Girbons committed Jan 24, 2020
1 parent 043d34f commit d44cd8d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@

Download the latest release:

- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader)
- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-osx)
- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader.exe)
- [Linux ARM](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-linux-arm)
- [Linux ARM64](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-linux-arm64)
- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader)
- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-osx)
- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader.exe)
- [Linux ARM](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-linux-arm)
- [Linux ARM64](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-linux-arm64)

Download the latest GUI release:

- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-gui-linux-amd64)
- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-gui-osx)
- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.21.0/comics-downloader-gui-windows.exe)
- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-gui-linux-amd64)
- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-gui-osx)
- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.21.1/comics-downloader-gui-windows.exe)

Put the script under a folder.

Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package version

// Tag specifies the current release tag.
// It needs to be manually updated.
const Tag = "v0.21.0"
const Tag = "v0.21.1"
15 changes: 9 additions & 6 deletions pkg/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"os"
"strings"
"time"

"github.com/Girbons/comics-downloader/pkg/util"
epub "github.com/bmaupin/go-epub"
Expand Down Expand Up @@ -237,19 +238,21 @@ func (comic *Comic) DownloadImages(outputFolder string) (string, error) {
return dir, err
}

client := &http.Client{
Transport: &http.Transport{
MaxIdleConns: 11,
IdleConnTimeout: 30 * time.Second,
},
}

for i, link := range comic.Links {
if link != "" {
rsp, err := http.Get(link)
rsp, err := client.Get(link)
if err != nil {
return dir, err
}
defer rsp.Body.Close()

// retrieve the image from the response
if err != nil {
return dir, err
}

imgFile, err := os.Create(fmt.Sprintf("%04d-image.%s", i, format))
if err != nil {
return dir, err
Expand Down

0 comments on commit d44cd8d

Please sign in to comment.