New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error downloading from MangaDex using latest release #52
Comments
Hi @dykn, I'll take a look asap! |
Is it possible it's an IP address block/ban? The VPS it's on doesn't have an option for a seconday/dynamic IP address, so I don't really have a way of knowing for sure. The error has persisted for over a week now, so I'm just making that assumption at this point. |
I guess so, the error is due to a json.Decode(response.Body) where Body is not a json. I'll check what is inside Body when this happen but I suppose that there's html inside. |
Thank you for the mention! I think you're right, @Girbons, I'll add an additional error check tomorrow. |
Thank you, it could be helpful. |
Please try the latest commit. It only decodes if the status is OK and shows the message otherwise. While testing, I got 503. This reports a HTML page with the message "Please stop spamming the server", however the client replies with the default message of "Service Unavailable". |
Thanks @bake, I'm going to try it out. |
Newest error, using latest release:
|
I've just tested it and got the same error. However, using the client directly works: func main() {
md := mangadex.New()
m, _, err := md.Manga("45112")
if err != nil {
log.Fatal(err)
}
fmt.Println(m.Title)
// Tensei Kenja wa Musume to Kurasu
} |
I'll take a look tomorrow on this, also noted that is the same error that I get while running tests on mangadex. |
FWIW it doesn't work for me with v0.21.2 but it does when I |
Might have something to do with MD using Cloudflare again. Could you please try to save the response? With something like httpcache: c := httpcache.New(diskcache.New("cache", diskcache.NoExpiration))
md := mangadex.New(mangadex.WithHTTPClient(c.Client())) I also noticed the output before the error message. Are you using the most recent commit? |
The response seems to be ok:
|
There seems to have been a breaking change in Go 1.14 which disallows invalid (in this case missing, see |
Please try the new commit, I've added a wrapper. |
Going to try the new commit thanks! |
Hey @bake thanks a lot, It works, I'm going to release a new version |
v0.21.3 released |
INFO[0000] Downloading... url="https://mangadex.org/title/907/i-am-a-hero"
ERRO[0530] could not get chapter 511880: could not decode response: invalid character '<' looking for beginning of value
Tried multiple different mangas/URLs.
Thanks.
The text was updated successfully, but these errors were encountered: