LINE
LINE copied to clipboard
longPoll() Problem
I made an echo bot using by client.longPoll() function, but I just got an "account banned" in a few minute.
Did you mean your IP is banned by line server?
I test the echo bot and my ip is banned about 40 minutes.
Same with me. I got banned after using longPoll()
, and this is affected to another device (in same network) who using LINE app on smartphone.
Luckily, I have dynamic internet IP, so I just need to restart my internet modem. But that's not a solution at all.
So, what is the longPoll()
problem actually?
@janglapuk
maybe the frequency of longPoll()
is too high.
I slowed down it and got fewer ban.
I tested my code in python shell, manually executing client.longPoll()
every few seconds.(I didnt execute it too regularly). The code is good and I got no ban.
@masahoshiro
I tried sleeping for a few random seconds between every client.longPoll()
, but I still get bans within a minute or two.
Mind to give some more details on how you stay unbanned?
So, it there any way to get unbanned? Or is it permanent?
Before, my IP gets banned frequently.. I subclassed LineClient class and uses my own THttpCllent which uses keep-alive connection instead of reopening the connection in every requests.
Well, it works for me before.. but unfortunately, my IP starts to get banned again lately.. dunno why
How long is your IP banned? 1 hour or longer?
every time my IP gets banned for 24 hours
I solve it by write some code below
while True: op_list = [] for op in client.longPool(): op_list.append(op) for op in op_list """some code""" time.sleep(1)
oh,no, indent was deleted
.....