carpedm20 / LINE

May the LINE be with you...
http://carpedm20.github.io/line/
Other
823 stars 192 forks source link

what tf do i have to do to make this work? #104

Closed doodspav closed 2 years ago

doodspav commented 7 years ago

starting with a blank server lamp server on Ubuntu 14.04.5, I login and enter this exact code on command line:

sudo apt-get update && sudo apt-get -y upgrade

sudo apt-get install python-pip

pip install --upgrade pip

pip install thrift==0.9.3

git clone https://github.com/carpedm20/LINE.git

cd LINE/line

wget https://gist.github.com/windows98SE/b739038218b6fe4d423f/raw/5f68cf3d9a2a88576b739810a6bd6fcaa0c5e940/api.py.patch --no-check-certificate

patch api.py < api.py.patch

cd ..

python config.py

python setup.py install

I then change http to https in api.py, and set isMac=False in client.py

I then open python and do this:

from line import LineClient client = LineClient("email","password") enter number into phone authToken=client.authToken print authToken client.updateAuthToken() you should get True here print authToken authToken=client.authToken print authToken client = LineClient(authToken=authToken)

I then make the echo.py file in the same place api models and client are, and I run it (using my authtoken)

it gives this, even though I managed to login before the get authToken:

Login Failed Traceback (most recent call last): File "/root/LINE/line/echo.py", line 12, in for op in client.longPoll(): NameError: name 'client' is not defined

What do I need to change/add to make this work?

ii64 commented 7 years ago

Login failed is global. you need find which one had a problem. by $ python >> from .....

ghost commented 7 years ago

anysz, could you be more specific? A lot of us are having this problem and if you know how to fix it, please elaborate.

ii64 commented 7 years ago

Login falied can be caused many problem first that you need to look is python 2.7.x then thrift 0.9.3 then another else like .line.crt cant be writed on disc. which mean you not the admin (if you host vps) or exception message from LINE server take a look -> #92 #93 #83 #98

or Check code line by line ex:

$ python Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>

1st. - If error, take a look traceback error:

>>> from line import LineClient, LineGroup, LineContact

2nd. - return login; if not, error exception code:

>>> client = LineClient("xxxx@xxx.xxx", "xxxxx", com_name="LOG_KIT")

3rd. - if this print code it mean its work. :

>>> client.authToken

brendhadhea commented 7 years ago

anysz this for windows?? Is there for linux or raspberry ?? https://gist.github.com/windows98SE/b739038218b6fe4d423f/raw/5f68cf3d9a2a88576b739810a6bd6fcaa0c5e940/api.py.patch

ii64 commented 7 years ago

This for all os support python include android.

Nilpo commented 7 years ago

Please make sure you are using Python2. The Line library does not support Python3.