metafates / mangal-scrapers

🌙 A collection of custom scrapers for mangal
37 stars 24 forks source link

ComicK scraper not working #12

Open vodkapmp opened 1 year ago

vodkapmp commented 1 year ago

When trying to use the ComicK scraper I am getting this issue. Doesn't matter what manga I try and get it to work with, all of them end up with this error.

Error                                                                                                 

  X Uggh, something went wrong. Maybe try again?                                                         

  Fighting an endless army of errors and bugs Mangal died a hero. Their last words were:                 

  /config/.config/mangal/sources/ComicK.lua:72: cannot perform div operation between nil and number      
  stack traceback:                                                                                       
      /config/.config/mangal/sources/ComicK.lua:72: in main chunk                                        
      [G]: ?
balajsra commented 4 months ago

Appears to be an issue with the ComicK API itself: https://api.comick.fun/docs/static/index.html.

Not sure there is anything that can be done on the scraper side since it relies on the API.

iishrnika commented 4 months ago

https://api.comick.io/docs/static/index.html might be because they keep changing the website url?

balajsra commented 4 months ago

Ah, good call. I guess this comment they have on the API docs is incorrect then:

You have to use the domain https://api.comick.fun/ (Don't use the domain https://comick.io/). Language code: https://en.wikipedia.org/wiki/Language_code, https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes

Using https://api.comick.io, the REST API appears to be working. I'll see if I can modify the scraper.

iishrnika commented 4 months ago

Ty!

balajsra commented 4 months ago

Well, ran into a roadblock already. I think the API only supports HTTPS requests, not HTTP. However, mangal does not appear to have the lua library for HTTPS/SSL included: https://github.com/metafates/mangal-lua-libs. I'm also not super familiar with lua or REST APIs in general, so this may be better suited for @metafates to resolve.

CanadianBaconBoi commented 2 weeks ago

@balajsra PR #26 is fully functional, can you review and merge?

balajsra commented 1 week ago

Looks like @metafates reviewed and merged it already. For what it's worth, I built the latest version of the main branch (see my gentoo ebuild here if interested) and confirmed that the ComicK scraper is functional again. Thanks @tcamargo for the fix and @CanadianBaconBoi for the ping!