consumet / api.consumet.org

A Modern Search Engine API for Anime, Movies/TVShows, Books, Light Novels, Manga, etc.
https://docs.consumet.org
GNU General Public License v3.0
1.11k stars 504 forks source link

[Libgen] 403 errors for both query urls #228

Closed pitsi closed 1 year ago

pitsi commented 1 year ago

Describe the bug

As mentioned in the title, libgen returns 403 errors for both query urls.

Steps to reproduce

For simplicity reasons, instead of some generic word that would return tens or even hundreds or results, e.g. "greek", the isbn of a specific book will be used as a term, thus the api would return only one result.

  1. Search for anything with the primary search url
    $ curl -s "https://api.consumet.org/books/s?bookTitle=9781501134630&page=1" 
    {"message":{"message":"Request failed with status code 403","name":"AxiosError","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.27.2"},"method":"get","url":"http://libgen.rs/search.php?req=9781501134630&view=simple&res=25&sort=def&sortmode=ASC&page=1"},"code":"ERR_BAD_REQUEST","status":403},"error":"internal_error"}

    or with the secondary one

    $ curl -s "https://api.consumet.org/books/libgen/s?bookTitle=9781501134630&page=1" 
    {"statusCode":400,"code":"ERR_BAD_REQUEST","error":"Bad Request","message":"Request failed with status code 403"
  2. Notice that in both cases the api fails with a 403 error.

Expected behavior

Normally, the api should return results. e.g. for the forementioned url the book is "Midnight in Chernobyl".

Actual behavior

However, it fails with a 403 error as seen above.

Additional context

The api was working properly yesterday morning (I live at gmt+2) when I last run my mini app that uses it to display info about books. I checked it again last night and it had the forementioned issue. I checked it again earlier today, like 4-5 hours ago and it was working again. And I checked it just now and it is broken again.

This app is my "homework" for a lesson that I should present to the "classroom" yesterday morning, but my presentation was postponed for Monday's morning. I hope it is fixed by then :)

pitsi commented 1 year ago

It is back up right now... If someone else can confirm that the api has/had downtimes and when they happen/happened, I would be grateful. It had no downtime all the week that I was writing my app.

riimuru commented 1 year ago

@pitsi It's most likely a problem with libgen servers. I'll look into the issue in a bit. You should record your app prior to the presentation in case it fails unexpectedly. Sorry for the inconvenience.

pitsi commented 1 year ago

Any news on that? Was it an issue on libgen's end? Thankfully it worked during my presentation and all went smoothly.

On the other hand, wasn't there a health status page for the hosted apis somewhere? I remember seeing something with red and green dots as indicators when I first discovered the api 2+ months ago...

wearrrrr commented 1 year ago

Yes there is a preview thing, it's on https://consumet.org under extensions.

pitsi commented 1 year ago

No offence, but I do not see a status indicator on that page. Plus, the linked url on libgen is wrong. It just points to "libgen", no domain suffix or https in front of it.

wearrrrr commented 1 year ago

The green/red dot in the corner is the status indicator, also that's definitely a small ui issue we will have to fix lol.

pitsi commented 1 year ago

I see no green/red dots or any status indicator on the forementioned page (screenshot upon request)... Do you mean this maybe? https://github.com/consumet/providers-status

riimuru commented 1 year ago

@pitsi He was talking about this: https://consumet.org/extensions/list/

Any news on that? Was it an issue on libgen's end? Thankfully it worked during my presentation and all went smoothly.

I'm glad that everything went well. Unfortunately, I was unable to reproduce the problem, which shows that it's libgens fault. We will add new book providers in case we face a similar issue.

pitsi commented 1 year ago

This is the page I am talking about too, that is why I just checked on different browsers. There are no green/red dots on the providers on my end... in brave and chromium, but they are visible in firefox! Oh well.

Feel free to close this if it is no longer an issue.