ArvinJA / scrape_discord

Scrape discord channels
27 stars 7 forks source link

Unclosed client session #3

Open Eremiel opened 6 years ago

Eremiel commented 6 years ago

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?

ArvinJA commented 6 years ago

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.

Eremiel commented 6 years ago

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.

ArvinJA commented 6 years ago

It looks like this?

python scrape_channels.py --user my@email.com --password mypassword -sid server_id --selfbot

Eremiel commented 6 years ago

python3 scrape_channels.py --user discorduser@email.com --password validpassword -sid id_of_sever --selfbot

Tried bot with and without channel_id. But getting same result - invalid credentials. Weird.

ArvinJA commented 6 years ago

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

Eremiel commented 6 years ago

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

ArvinJA commented 6 years ago

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?

vinnytroia commented 4 years ago

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 commented 4 years ago

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