d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Log In Pick Up Logs Using Python Script
Add Reply New Topic New Poll
Member
Posts: 3
Joined: Dec 25 2020
Gold: 0.01
Dec 27 2020 09:56pm
Hi guys,

I'm currently trying to log in to my account using a python bot.
I am using the username and authk to log in and pick up the logs i have in my account page.

When i try to retrieve data from the response, i have a bad request response message, which means the format or the values of the data i send is wrong.

Quote
def connectIrc:
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "[IRC] Connecting to : " + server

irc.connect((server, port))
print "[IRC] Connected"

irc.send("NICK #{%s}\n" % userid)

irc.send("USER U{%s} njIRCIM chat.d2jsp.org :njIRCIM User ID {%s}\n" % (userid, userid))

irc.send("FAUTH {%s}\n" % authk)
print "[IRC] Authenticated..."


Quote
irc = connectIrc()

try:

text = irc.recv(2040)



userid is a number (digits), the authk is a hash i think in base64.

Can you please tell me what is wrong in the code i have ?


Many thanks in advance.

This post was edited by adamhardpr on Dec 27 2020 09:58pm
Member
Posts: 12,786
Joined: May 17 2013
Gold: 4,010.00
Dec 28 2020 05:06am
it's a websocket, not a plain socket

check this:
https://stackoverflow.com/questions/4973622/difference-between-socket-and-websocket

if you implemented it yourself, you need a proper handshake to switch HTTP protocol

This post was edited by Klexmoo on Dec 28 2020 05:08am
Member
Posts: 3
Joined: Dec 25 2020
Gold: 0.01
Dec 28 2020 05:34pm
Thanks for the reply.

I managed to fix with websocket and ssl through pot 2053.

Thanks again.

Go Back To Programming & Development Topic List
Add Reply New Topic New Poll