scrape_discord icon indicating copy to clipboard operation
scrape_discord copied to clipboard

Unclosed client session

Open Eremiel opened this issue 8 years ago • 9 comments

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?

Eremiel avatar Feb 06 '18 17:02 Eremiel

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.

ArvinJA avatar Feb 06 '18 17:02 ArvinJA

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.

Eremiel avatar Feb 06 '18 18:02 Eremiel

It looks like this?

python scrape_channels.py --user [email protected] --password mypassword -sid server_id --selfbot

ArvinJA avatar Feb 06 '18 19:02 ArvinJA

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.

Eremiel avatar Feb 07 '18 08:02 Eremiel

It's working on my end, but here are a few things to try, to see if it changes anything:

  1. Try another version of python, python 3.6.4 works for me
  2. 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

ArvinJA avatar Feb 07 '18 11:02 ArvinJA

Thanks! Token mode works with python 2.7.12. To use user/pass I had to downgrade, weird ;-)

Eremiel avatar Feb 07 '18 15:02 Eremiel

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?

ArvinJA avatar Feb 07 '18 15:02 ArvinJA

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?

vinnytroia avatar Sep 04 '19 00:09 vinnytroia

I figured it out. i needed to install the PIP discord client pip3 install -U discord.py

vinnytroia avatar Sep 04 '19 01:09 vinnytroia