Unclosed client session
So I am trying to use the script with aiohttp-2.3.7 yarl-1.1.0 and client/password mode.
but keep getting:
Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fa011ae6dd8>
Any idea why its happening?
Yes, you need to use the --selfbot flag as well, note that using selfbots is not recommended and may yield an account ban, although what you do is up to you. Recommended usage is of course to use a real bot account.
I've pushed an update to highlight this.
Hm,
/.local/lib/python3.5/site-packages/discord/http.py", line 200, in request raise HTTPException(r, data) discord.errors.HTTPException: BAD REQUEST (status code: 400)
The above exception was the direct cause of the following exception: ... .local/lib/python3.5/site-packages/discord/http.py", line 246, in email_login raise LoginFailure('Improper credentials have been passed.') from e discord.errors.LoginFailure: Improper credentials have been passed. Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fb1a1993da0>
I've checked the login/password several times. Also changed the password to exclude special characters, but it doesnt help.
It looks like this?
python scrape_channels.py --user [email protected] --password mypassword -sid server_id --selfbot
python3 scrape_channels.py --user [email protected] --password validpassword -sid id_of_sever --selfbot
Tried bot with and without channel_id. But getting same result - invalid credentials. Weird.
It's working on my end, but here are a few things to try, to see if it changes anything:
- Try another version of python, python 3.6.4 works for me
- Try logging in using a token, this is possible even with selfbots, here's how to retrieve it.
then run
python scrape_channels.py --token [token] -sid [server_id] --selfbot
I'll post more ideas as I come up with them
Thanks! Token mode works with python 2.7.12. To use user/pass I had to downgrade, weird ;-)
Hm, didn't even know the code worked with any python2 version at all, will need to investigate. What exact version of python 3.5 did you have problems with btw?
Was this ever resolved. I am running into the same issue running on Python 3.6. I have tried with both a token and username/password, and i get the same error
When using Token: Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fbedb8b97b8>
when using user/pass: Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f7ff3519780>
any idea what i can try? What is causing this error? is there an actual unclosed session somewhere?
I figured it out. i needed to install the PIP discord client pip3 install -U discord.py