abhinavk99 / jikanpy

Python wrapper for the Jikan API
MIT License
217 stars 29 forks source link

getting APIException when trying to view a different page than the first one of any search result #107

Closed redooo98 closed 1 year ago

redooo98 commented 1 year ago

since any search result returns a dictionary with a max of 25 results, i am simply trying to view the other pages. but whenever i try doing so i get this error:

File "c:\Users\me\Desktop\test.py", line 139, in jikansearch
    search= jikan.seasons(extension='upcoming', page=1)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\jikanpy\jikan.py", line 316, in seasons
    return self._request(
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\jikanpy\jikan.py", line 85, in _request
    return self._wrap_response(response, url, **kwargs)
  File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\jikanpy\jikan.py", line 79, in _wrap_response
    raise APIException(response.status_code, json_response, **kwargs)
jikanpy.exceptions.APIException: HTTP 500 - status=500, type=Exception, message=Unhandled Exception. Please follow report_url to generate an issue on GitHub, trace=/var/www/jikan-rest/vendor/jenssegers/mongodb/src/Query/Builder.php at line 558, error=Unsupported operand types: string - int, report_url=https://github.com/jikan-me/jikan-rest/issues/new?title=%5BOFFICIAL%5D+Generated+Issue%3A+TypeError&body=Please+fill+out+the+details+below.%0A%0A%2A%2ASummary%3A%2A%2A%0A%0A%2A%2ASteps+to+reproduce%3A%2A%2A%0A%0A%0A%0A+%23%23%23+Additional+Details+%0A+%2A%2AJikan+Parser+Version%2A%2A%3A+%60%60%60v4.0.2%404df99e0df5a4adf2b92e7c6fc663de8fd4b9c325%60%60%60%0A%2A%2APHP%3A%2A%2A+%60%60%608.0.19%60%60%60%0A%2A%2ARedis%2A%2A%3A+%60%60%60Connected%60%60%60%0A%2A%2AException%3A%2A%2A+%60%60%60TypeError%60%60%60%0A%2A%2ACode%3A%2A%2A+%60%60%600%60%60%60%0A%2A%2AMessage%3A%2A%2A+%60%60%60Unsupported+operand+types%3A+string+-+int%60%60%60%0A%2A%2ATrace%3A%2A%2A+%60%60%60%2Fvar%2Fwww%2Fjikan-rest%2Fvendor%2Fjenssegers%2Fmongodb%2Fsrc%2FQuery%2FBuilder.php+on+line+558%60%60%60%0A%2A%2ARequest%3A%2A%2A+%60GET+%2Fv4%2Fseasons%2Fupcoming%3Fpage%3Dv%60%0A for year=None, season=None, extension=upcoming, page=1

i don't know if i am doing something wrong, i am using jikanpy-v4. thank you!

Chris-Peterson444 commented 1 year ago

It looks like the generated URL when paging on the /seasons/upcoming/ endpoint isn't correct. This is on our end. Give me a little bit and I can take a look at this and fix it.

Chris-Peterson444 commented 1 year ago

It looks like this is an issue related to #106. After the pull request, I forgot to push the changes to PyPI.

Chris-Peterson444 commented 1 year ago

After pushing the new version to PyPI, I can confirm the issue isn't replicated. The new version on PyPI is 1.0.2. Thanks for bringing this up @redooo98. I am going to close it for now, but if you have further issues with this feel free to re-open it.