Skip to content
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

BUG: Calling load_rank / get_rank freezes loop #77

Open
DJJ05 opened this issue Feb 4, 2021 · 2 comments
Open

BUG: Calling load_rank / get_rank freezes loop #77

DJJ05 opened this issue Feb 4, 2021 · 2 comments

Comments

@DJJ05
Copy link

DJJ05 commented Feb 4, 2021

Here is my full code:

        try:
            account = await self.auth.get_player(account_name, r6sapi.Platforms.UPLAY)
        except r6sapi.exceptions.InvalidRequest:
            raise commands.BadArgument("Couldn't find a Uplay account with that name.")
        
        try:
            await account.check_level()
            await account.check_general()
            # await account.load_rank('NA')
        except:
            raise commands.BadArgument("Found the Uplay account but couldn't gather any information.")

After executing this code, accessing attributes such as matches_won, or xp seems to work fine, however as soon as the commented out load_rank is added into the program, the program will never go past that, any code below that line will not execute at all, and no exceptions are caught by the except clause. It seems to simply freeze the loop when ran.

@DJJ05
Copy link
Author

DJJ05 commented Feb 4, 2021

Update:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/r6sapi/players.py", line 307, in get_rank
    result = yield from self.load_rank(region, season, data=data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/r6sapi/players.py", line 277, in load_rank
    rank_definitions = yield from self.auth.get_rank_definitions()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/r6sapi/auth.py", line 522, in get_rank_definitions
    data = yield from resp.json()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1097, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://www.ubisoft.com/en-gb/game/rainbow-six/siege/stats')

After waiting several minutes, the program eventually throws a ContentTypeError. This applies for all 3 regions I've tried, NA, EU, and ASIA.

@Jackywathy
Copy link
Contributor

what version of the library are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants