diff --git a/CHANGELOG.md b/CHANGELOG.md index cf2e06a..305ac6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +[Changes][v0.33.4] + + +# [0.33.4 (v0.33.4)](https://github.com/Girbons/comics-downloader/releases/tag/v0.33.3) - 3 Jan 2023 + +# Fixes + +- #125: Added new comicextra domain by @bhm. +- #126: Fixed -all argument for readallcomics. + [Changes][v0.33.3] diff --git a/README.md b/README.md index dab13d2..bf7690f 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,17 @@ Download the latest release: -- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader) -- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-osx) -- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader.exe) -- [Linux ARM](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-linux-arm) -- [Linux ARM64](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-linux-arm64) +- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader) +- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-osx) +- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader.exe) +- [Linux ARM](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-linux-arm) +- [Linux ARM64](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-linux-arm64) Download the latest GUI release: -- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-gui) -- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-gui-osx) -- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.33.3/comics-downloader-gui-windows.exe) +- [Linux](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-gui) +- [Mac OSX](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-gui-osx) +- [Windows](https://github.com/Girbons/comics-downloader/releases/download/v0.33.4/comics-downloader-gui-windows.exe) ## Usage diff --git a/go.mod b/go.mod index 62d4d02..df36e07 100644 --- a/go.mod +++ b/go.mod @@ -13,12 +13,11 @@ require ( github.com/schollz/progressbar/v2 v2.15.0 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 - golang.org/x/mod v0.5.1 + golang.org/x/mod v0.6.0 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c ) require ( - github.com/darylhjd/mangodex v0.0.0-20211231093527-e4a91c518fa0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dsnet/compress v0.0.1 // indirect github.com/frankban/quicktest v1.14.0 // indirect @@ -31,7 +30,7 @@ require ( github.com/gofrs/uuid v3.1.0+incompatible // indirect github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/go-cmp v0.5.6 // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/nwaples/rardecode v1.1.2 // indirect @@ -44,7 +43,7 @@ require ( github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect golang.org/x/image v0.0.0-20200430140353-33d19683fad8 // indirect golang.org/x/net v0.0.0-20210505024714-0287a6fb4125 // indirect - golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect + golang.org/x/sys v0.1.0 // indirect golang.org/x/text v0.3.6 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index 05946b5..ade89b5 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,6 @@ github.com/bmaupin/go-epub v0.10.0 h1:KuOrBGE72frtaDDb2j7NyryO1In3Wsdmtm8o0/K8mF github.com/bmaupin/go-epub v0.10.0/go.mod h1:mBan+0WgVv5JbPNw1xfnfQoTRN9iPMKBshZwPOL0SY0= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/darylhjd/mangodex v0.0.0-20211231093527-e4a91c518fa0 h1:yi35YUun+KDGbTJv2r0IpM91Lq65msUhANU3Q/xr2Xc= -github.com/darylhjd/mangodex v0.0.0-20211231093527-e4a91c518fa0/go.mod h1:RApCWGRbVd11wQMLhiZ1ejybkf1C4CS6rMANQlog8B0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -39,8 +37,9 @@ github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBs github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -112,8 +111,8 @@ golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw= golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -132,8 +131,9 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -145,7 +145,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/version/version.go b/internal/version/version.go index a79158b..f29ff6d 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -9,7 +9,7 @@ import ( // Tag specifies the current release tag. // It needs to be manually updated. -const Tag = "v0.33.3" +const Tag = "v0.33.4" // IsNewAvailable will fetch the latest project releases // and will compare the latest release Tag against the current Tag. diff --git a/pkg/detector/detector.go b/pkg/detector/detector.go index 3920e52..fadc117 100644 --- a/pkg/detector/detector.go +++ b/pkg/detector/detector.go @@ -13,6 +13,7 @@ var SupportedSites = map[string]map[string]bool{ "readcomiconline.li": {"isDisabled": false}, "readcomicsonline.ru": {"isDisabled": false}, "www.comicextra.com": {"isDisabled": false}, + "ww1.comicextra.com": {"isDisabled": false}, "www.mangahere.cc": {"isDisabled": false}, "www.mangatown.com": {"isDisabled": false}, "mangakakalot.com": {"isDisabled": false}, diff --git a/pkg/sites/loader.go b/pkg/sites/loader.go index 22bd933..a585035 100644 --- a/pkg/sites/loader.go +++ b/pkg/sites/loader.go @@ -10,7 +10,6 @@ import ( "github.com/Girbons/comics-downloader/pkg/config" "github.com/Girbons/comics-downloader/pkg/core" "github.com/Girbons/comics-downloader/pkg/util" - "golang.org/x/exp/slices" ) func initializeCollection(issues []string, options *config.Options, base BaseSite) ([]*core.Comic, error) { @@ -87,8 +86,6 @@ func notInIssuesRange(issueNumber string, start, end float64) bool { // LoadComicFromSource will return an `comic` instance initialized based on the source func LoadComicFromSource(options *config.Options) ([]*core.Comic, error) { - // this probably needs to land in the comicextra.go - const supportedComicExtra := []string{"ww1.comciextra.com", "www.comicextra.com"} var ( base BaseSite issues []string @@ -99,7 +96,7 @@ func LoadComicFromSource(options *config.Options) ([]*core.Comic, error) { switch sourceUrl := options.Source; sourceUrl { case "readcomiconline.li": base = NewReadComiconline(options) - case supportedComicExtra.contains(soureUrl): + case "ww1.comicextra.com", "www.comicextra.com": base = NewComicextra(options) case "mangareader.tv": base = NewMangareader(options) diff --git a/pkg/sites/readallcomics.go b/pkg/sites/readallcomics.go index 431bc94..49b4e43 100644 --- a/pkg/sites/readallcomics.go +++ b/pkg/sites/readallcomics.go @@ -10,6 +10,8 @@ import ( "github.com/anaskhan96/soup" ) +const DefaultUrl string = "https://readallcomics.com" + // Readallcomics represents a Readallcomics instance. type Readallcomics struct { options *config.Options @@ -57,29 +59,31 @@ func (r *Readallcomics) getIssues(url string) ([]string, error) { return nil, err } - // html tag to be extracted. - tagToExtract := "a" - // html tag value to be extracted. - tagValueToExtract := "href" - // retrieve links from main comic page. doc := soup.HTMLParse(response) - // apply default strategy to get issues link - chapters := doc.Find("ul", "class", "list-story") - - if chapters.Error != nil { - // retrieve links from comic page. - chapters = doc.Find("select", "id", "selectbox") - tagToExtract = "option" - tagValueToExtract = "value" - } - for _, chapter := range chapters.FindAll(tagToExtract) { - issueUrl := chapter.Attrs()[tagValueToExtract] - if util.IsURLValid(issueUrl) { - links = append(links, issueUrl) + if strings.Contains(url, "category") { + chapters := doc.Find("ul", "class", "list-story").FindAll("a") + for _, chapter := range chapters { + issueUrl := chapter.Attrs()["href"] + if util.IsURLValid(issueUrl) { + links = append(links, issueUrl) + } + + } + } else { + chapters := doc.Find("select", "id", "selectbox").FindAll("option") + for _, chapter := range chapters { + issueUrl := chapter.Attrs()["value"] + if util.IsURLValid(issueUrl) { + links = append(links, issueUrl) + } } } + if r.options.Debug { + r.options.Logger.Debug(fmt.Sprintf("Image Links found: %s", strings.Join(links, " "))) + } + return links, nil } @@ -87,21 +91,30 @@ func (r *Readallcomics) getIssues(url string) ([]string, error) { func (r *Readallcomics) RetrieveIssueLinks() ([]string, error) { url := r.options.URL - chapters, err := r.getIssues(url) + if r.options.All || r.options.Last { - if err != nil { - return nil, err - } + if (r.options.All || r.options.Last) && !strings.Contains(url, "category") { + // override url to retrieve chapters + comicName := strings.Join(strings.Split(url, "/")[3:], "") + url = fmt.Sprintf("%s/category/%s", DefaultUrl, comicName) + } - if r.options.Last { - return []string{chapters[len(chapters)-1]}, nil - } + chapters, err := r.getIssues(url) + if err != nil { + return nil, err + } + + if r.options.Last { + return []string{chapters[len(chapters)-1]}, nil + } - if r.options.All && len(chapters) == 1 { - return []string{chapters[0]}, err + if r.options.All && len(chapters) == 1 { + return []string{chapters[0]}, err + } + return chapters, err } - return chapters, err + return []string{url}, nil } // GetInfo extracts the comic info from the given URL.