OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
175 stars 44 forks source link

Asyncio AttributeError While Authenticating XBL Account #53

Closed uxm5jc closed 1 year ago

uxm5jc commented 3 years ago

Hello, I am running CentOS7 and am currently trying to run the below xbox-authenticate command. When I run this it opens a page in my existing browser session and then opens a Microsoft accounts page asking me to give permissions for the API. I do as such, and afterwards redirect to a blank screen with the plain text "500 Internal Server Error Server got itself in trouble" and the following errors from the console below. This also no longer pulls up the CLI cash/crunch prompt and simply is blank after the AttributeError. This only ever changed when I accidentally hit Ctrl+C with the wrong terminal open and after the fact I was left with the error below the dashed lines. I've attempted troubleshooting around for this error online but often end up finding some stuff on an error between python versions but am unsure how to apply any of the solution to these people's problems to my own, though I'll be sure to drop the issue if I somehow find something. Any assistance you wizards can conjure for me?

xbox-authenticate --client-id (My Client ID) --client-secret (My Client Secret's ID)

Opening in existing browser session. Error handling request Traceback (most recent call last): File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib64/python3.6/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.6/site-packages/xbox/webapi/scripts/authenticate.py", line 25, in auth_callback asyncio.create_task(queue.put(request.query["code"])) AttributeError: module 'asyncio' has no attribute 'create_task'

----------After hitting Ctrl-C on mistake I recieved this error and the terminal allowed me to input commands again---------

^CTraceback (most recent call last): File "/usr/local/bin/xbox-authenticate", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/site-packages/xbox/webapi/scripts/authenticate.py", line 97, in main async_main(args.client_id, args.client_secret, args.redirect_uri, args.tokens) File "/usr/lib64/python3.6/asyncio/base_events.py", line 471, in run_until_complete self.run_forever() File "/usr/lib64/python3.6/asyncio/base_events.py", line 438, in run_forever self._run_once() File "/usr/lib64/python3.6/asyncio/base_events.py", line 1415, in _run_once event_list = self._selector.select(timeout) File "/usr/lib64/python3.6/selectors.py", line 445, in select fd_event_list = self._epoll.poll(timeout, max_ev) KeyboardInterrupt [~]$

uxm5jc commented 3 years ago

Figured a solution out by accident while just generally double/triple-checking that I wasn't being incompetent and had all of my stuff correctly installed(dependencies, that kinda stuff), but may have accidentally tripped over another road-block anyways, so maybe I'll be back to issues page soon(hopefully not though). Thank you again though for your hard work in developing this, very cool stuff and I'm hyped to get over my own fumbling and get it working!

uxm5jc commented 3 years ago

As it turns out, I was entirely wrong about the solution. My computer was just acting weird. Currently my method for fixing this that I'm researching rn is downgrading my python version from my self-installed 3.8 back to 3.6. So I'm leaving this open for help again in the event that indeed the solution to my problem isnt this, or if another issue with my solution comes up. Sorry though if seeing that closed and reopened messages above me is a little annoying.

Gurrman375 commented 3 years ago

I had the issue of it authenticating. When I changed to python 3.7.9 it appears to work great. I think latter versions of python affect how it can run.

It won't work with 3.6 and below because asyncio.run can't be run through 3.6 and less.

tuxuser commented 1 year ago

Yep, 3.7+ is required