LINE icon indicating copy to clipboard operation
LINE copied to clipboard

How to setup argument in loginWithIdentityCredentialForCertificate()

Open sschang123 opened this issue 10 years ago • 4 comments

Hi, I have a scenario. I will have many robots on different pcs in a intranet, and each pcs have its own virtual ip address.

  1. How to setup argument ip, computer name in loginWithIdentityCredentialForCertificate() in each robots?
  2. How LINE identify each robots? Thank you.

sschang123 avatar Jan 19 '16 08:01 sschang123

For IP address, you can add getter/setter in api.py.

For computer name you can set by passing 5th argument when init LineClient:

    def __init__(self, id=None, password=None, authToken=None, is_mac=True, com_name="PC"):

anusoft avatar Jan 21 '16 07:01 anusoft

In case that you want auto detect try editing api.py to set default IP by using this line:

import socket
ip = [(s.connect(('8.8.8.8', 80)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]

Source: http://stackoverflow.com/a/1267524/404906

anusoft avatar Jan 21 '16 07:01 anusoft

Thanks for reply. I have some more questions:

  1. Will LINE server use ip address and device name to identify each client(robot)?
  2. If same LINE user account login 2 different robots, what's the result? will this be banned by LINE? Is this scenario workable?

sschang123 avatar Jan 21 '16 08:01 sschang123

  1. I don't know, maybe but unlikely since LINE will banned entire public IP if they found it's bots.
  2. First bots will got kicked out. Only LINE for Ipad and PC can be logged in at the same time.

anusoft avatar Jan 21 '16 08:01 anusoft