fadhiilrachman / line-py Goto Github PK
View Code? Open in Web Editor NEWLINE Messaging's private API
License: BSD 3-Clause "New" or "Revised" License
LINE Messaging's private API
License: BSD 3-Clause "New" or "Revised" License
I know about Messaging API but I can't purchase premium id for my bot. I don't know why. Who can buy?
Is there any way to implement "line-py" with line@ ?
when someone add me I use findAndAddContactsByMid(op.param1) to add him , and this is successful but when I want to send some notify message to him , and it is error, and system give an error message to me like this
[2018-06-08 09:10:50.346069] TalkException(code=82, reason='can not send using plain mode', parameterMap=None)
does anyone know how to fix it???
thx!!!
This Error : TalkException(code=0, reason=Invalid size of contactIds', parameterMap=None)
while True:
poll.trace()
5 minutes is working, but next minutes cant respond from user input.
like when i send to bot, its always autoread, but sometimes is not autoread
I have a problem like this, please help me :(
Traceback (most recent call last):
File "echobot.py", line 4, in
line = LINE('My Email', 'My Password')
File "/usr/local/lib/python3.5/site-packages/linepy/client.py", line 18, in init
self.loginWithCredential(_id=idOrAuthToken, passwd=passwd, certificate=certificate, systemName=systemName, appName=appName, keepLoggedIn=keepLoggedIn)
File "/usr/local/lib/python3.5/site-packages/linepy/auth.py", line 73, in loginWithCredential
rsaKey = self.tauth.getRSAKeyInfo(self.provider)
File "/usr/local/lib/python3.5/site-packages/akad/TalkService.py", line 5109, in getRSAKeyInfo
self.send_getRSAKeyInfo(provider)
File "/usr/local/lib/python3.5/site-packages/akad/TalkService.py", line 5118, in send_getRSAKeyInfo
self._oprot.trans.flush()
File "/usr/local/lib/python3.5/site-packages/thrift/transport/THttpClient.py", line 141, in _f
result = f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/thrift/transport/THttpClient.py", line 181, in flush
self.__http.endheaders()
File "/usr/local/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/local/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/local/lib/python3.5/http/client.py", line 1260, in connect
server_hostname=server_hostname)
File "/usr/local/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/usr/local/lib/python3.5/ssl.py", line 752, in init
self.do_handshake()
File "/usr/local/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/usr/local/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:645)
instead of:
getActivePurchases(start,size,country,language)
can it please be:
getActivePurchases(country, language, start=0, size=99999)
because i think people might be confused as to how to use it otherwise
i get the error in the title every time someone posts a contact or sticker, and i think it is causing the contenttypes to not work properly
That's is my problem, my bot got text=None, with the example groupbot.
Does anyone know how to craete a group post?
I have already try createGroupPost, but however how hard I had tried, it still post on my home, I had already try to put the gid and mid in the needed in createGroupPost, but both are unuseful,help~~~~~~
thx QAQQQQQQQQQ
Thanks for the great work you have done, but i have a question on how to handle a template message like button, confirm, carousel, i mean how to make this bot to interact with that kind of message, example of the template message can be found on official line bot https://developers.line.me/en/docs/messaging-api/message-types/#template-messages
Thank you
Input this PIN code '0002' on your LINE for smartphone in 2 minutes
[2018-02-08 19:46:33.156521] [mønö] : Login success
[2018-02-08 19:46:44.130510] Your LINE account is not support Square
Traceback (most recent call last):
File "e.py", line 4, in
line = LINE('****@gmail.com', '*****)
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/client.py", line 22, in init
self.__initAll()
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/client.py", line 33, in __initAll
Timeline.init(self)
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/timeline.py", line 18, in init
Channel.init(self, self.channel, self.server.CHANNEL_ID['LINE_TIMELINE'], False)
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/channel.py", line 20, in init
self.__loginChannel()
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/channel.py", line 27, in __loginChannel
self.channelResult = self.approveChannelAndIssueChannelToken(self.channelId)
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/channel.py", line 6, in checkLogin
return func(*args, **kwargs)
File "/data/data/com.termux/files/home/line-py/line-py/line-py/linepy/channel.py", line 41, in approveChannelAndIssueChannelToken
return self.client.approveChannelAndIssueChannelToken(channelId)
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/akad/ChannelService.py", line 243, in approveChannelAndIssueChannelToken
return self.recv_approveChannelAndIssueChannelToken()
File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/akad/ChannelService.py", line 267, in recv_approveChannelAndIssueChannelToken
raise result.e
akad.ttypes.ChannelException: ChannelException(code=3, reason='REVOKE', parameterMap=None)
What i have to do ?
I want to make a bot to get the mid who has read and then turn into name, finally send it to the group
......but I have some problem......
who can help me QAQ
THANKS~~~
how can i take the midlist in group
thanks!
so as the title suggests, when i try to start a call, i get this error:
TalkException(reason='Incompatible app version', parameterMap=None, code=11)
define findAndAddContactsByMid(self, reqSeq, mid, type, reference) in TalkService
But uses self.talk.findAndAddContactsByMid(0, mid) in client.py
So i got error
findAndAddContactsByMid() missing 2 required positional arguments: 'type' and 'reference'
Please fix this
happy great job for you before.
so, how i delete contact ...
i am find with linepy but i cant fund it
When I try:
client.findGroupByTicket(ID)
TalkException(parameterMap={}, code=99, reason='group key member mismatch')
I got this error, when I try to login with email and password.
How can i fix this?
( I'm using Python 3.6.2 and linepy 3.0.6. )
code
from linepy import *
line = LINE('EMAIL', 'PASSWORD')
line.log("Auth Token : " + str(line.authToken))
error
[2018-01-15 11:28:21.247885] [xxx] : Login success
Traceback (most recent call last):
File "line2.py", line 12, in <module>
line = LINE('EMAIL', "PASSWORD")
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/linepy/client.py", line 22, in __init__
self.__initAll()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/linepy/client.py", line 35, in __initAll
self.squares = self.getJoinedSquares()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/linepy/square.py", line 7, in checkLogin
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/linepy/square.py", line 266, in getJoinedSquares
return self.square.getJoinedSquares(rq)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/akad/SquareService.py", line 1833, in getJoinedSquares
return self.recv_getJoinedSquares()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/akad/SquareService.py", line 1857, in recv_getJoinedSquares
raise result.e
akad.ttypes.SquareException: SquareException(errorCode=403, errorExtraInfo=None, reason='対応していないか不正なURLです。')
I think wiki can be edited by community, like add some tutorial or Example, FAQ
add line shop in next update pls
This is just a question,please answer my question
i got an error when i try like and comment function
{u'message': u'Your request has not been\nprocessed due to a temporary error.\nPlease try again.', u'code': 500, u'result': None}
unsendMessage(self, messageID, wait=0)
and if wait is bigger than 0, wait that amount of time before unsending the message.
i would suggest code using threading, but im sure u can come up with that (or better) yourself.
Hi, please help, now i cant login using link provided when start, before it is work, is it from Line that change something?
Traceback (most recent call last):
File "E:/SHARE/scripts/line-py-master/singletrace.py", line 4, in
client = LineClient()
File "E:\SHARE\scripts\line-py-master\linepy\client.py", line 24, in init
self.qrLogin(keepLoggedIn=keepLoggedIn, systemName=systemName, appName=appName, showQr=showQr)
File "E:\SHARE\scripts\line-py-master\linepy\api.py", line 121, in qrLogin
self.tokenLogin(result.authToken, appName)
File "E:\SHARE\scripts\line-py-master\linepy\api.py", line 133, in tokenLogin
self.loadSession()
File "E:\SHARE\scripts\line-py-master\linepy\api.py", line 30, in loadSession
self.revision = self.poll.getLastOpRevision()
File "build\bdist.win32\egg\akad\TalkService.py", line 3440, in getLastOpRevision
File "build\bdist.win32\egg\akad\TalkService.py", line 3463, in recv_getLastOpRevision
akad.ttypes.TalkException: TalkException(parameterMap=None, reason=u'LOG_OUT', code=8)
i try with createChatRoomAnnouncement(grup id,0,'teks')
but its say 'str' object has no attribute 'write', any solution for this?
[2018-01-19 17:37:18.940952] Your LINE account is not support Square
And
akad.ttypes.ChannelException: ChannelException(parameterMap=None, reason='REVOKE', code=3)
I try using func removeMessage, and thats doesnt work. But i forgot the error code :v
What channel id for square? For acces and login square
Apakah API ini masih bisa dijalankan?
Hey so i tried deploying this to Heroku. It was working fine at first, but later on i get this error:
2018-01-16T14:19:52.743896+00:00 heroku[web.1]: Starting process with command
python sb.py
2018-01-16T14:20:04.706960+00:00 app[web.1]: [2018-01-16 14:20:04.706869] [TesBot] : Login success
2018-01-16T14:20:04.707003+00:00 app[web.1]: [2018-01-16 14:20:04.706960] Auth Token : -
2018-01-16T14:20:06.833303+00:00 app[web.1]: [2018-01-16 14:20:06.833212] [TesBot] : LineTimeline attached
2018-01-16T14:20:07.940032+00:00 app[web.1]: [2018-01-16 14:20:07.939941] [TesBot] : Success login to Timeline
2018-01-16T14:20:07.940052+00:00 app[web.1]: [2018-01-16 14:20:07.940011] Channel Access Token : -
2018-01-16T14:20:53.163182+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-01-16T14:20:53.163293+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-01-16T14:20:53.255695+00:00 heroku[web.1]: Process exited with status 137
2018-01-16T14:20:53.269183+00:00 heroku[web.1]: State changed from starting to crashed
What happened there?
I am concern for ban. I have some question?
Do you emulate mobile or desktop line client. Can you show how do you sniff packet?
How can I get official value from official line client.
'User-Agent' -> 'Line/7.18.1'
'X-Line-Application' -> 'DESKTOPWIN 7.18.1 FDLRCN 11.2.5'
Is there a need for this because from above it say that it is Windows.
'X-Line-Carrier' -> '51089, 1-0' -> Hutchison CP Telecommunications
Thanks
Hello, i have a problem.
I use code, this:
-- coding: utf-8 --
from linepy import *
client = LineClient()
#client = LineClient(authToken='AUTHTOKEN')client.log("Auth Token : " + str(client.authToken))
Then, i got result Internal Error :
akad.ttypes.TalkException: TalkException(parameterMap=None, reason=u'Internal error', code=20)
How?
Input this PIN code '7739' on your LINE for smartphone in 2 minutes
Traceback (most recent call last):
File "...linepy\auth.py", line 123, in login
'e2eeVersion': 0
File "...linepy\auth.py", line 48, in loginRequest
if data['identityProvider']:
KeyError: 'identityProvider'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 3, in
cl = LineClient(id=mail,passwd=password)
File "...linepy\client.py", line 26, in init
self.login(_id=id, passwd=passwd, certificate=certificate, systemName=systemName, appName=appName, keepLoggedIn=keepLoggedIn)
File "...linepy\auth.py", line 127, in login
raise Exception("Login failed")
Exception: Login failed
When I login with email and password, these error happen.
Would you please fix it?
I tested with Python 3.6.4, akad 0.10.21, and line-py 2.0.1.
OpType.NOTIFIED_TYPING: TYPING
elif "like" == msg.text:
sender = msg._from
typel = [1001,1002,1003,1004,1005,1006]
hasil = line.getHomeProfile(mid=msg.to)
st = hasil['result']['feeds']
for i in range(len(st)):
test = st[i]
result = test['post']['postInfo']['postId']
# line.likePost(str(result), likeType=random.choice(typel))
line.likePost(mid=line.profile.mid, postId=result)
# line.createComment(str(sender), str(result), 'Auto Like by none')
line.sendMessage(receiver, 'Like & Comment '+str(len(st))+' Post From None')
there is no error.but not successfully.
help me :(
any example how to get operation type and key in logs?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "linepy/client.py", line 24, in __init__
self.qrLogin(keepLoggedIn=keepLoggedIn, systemName=systemName, appName=appName, showQr=showQr)
File "linepy/api.py", line 121, in qrLogin
self.tokenLogin(result.authToken, appName)
File "linepy/api.py", line 133, in tokenLogin
self.loadSession()
File "linepy/api.py", line 30, in loadSession
self.revision = self.poll.getLastOpRevision()
File "/usr/local/lib/python2.7/dist-packages/akad/TalkService.py", line 3440, in getLastOpRevision
return self.recv_getLastOpRevision()
File "/usr/local/lib/python2.7/dist-packages/akad/TalkService.py", line 3451, in recv_getLastOpRevision
(fname, mtype, rseqid) = iprot.readMessageBegin()
File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TCompactProtocol.py", line 323, in readMessageBegin
proto_id = self.__readUByte()
File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TCompactProtocol.py", line 302, in __readUByte
result, = unpack('!B', self.trans.readAll(1))
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 65, in readAll
raise EOFError()
EOFError
Today LINE server got updated. I use this module for my project and now I cannot login or update my work. Please help
client.updateProfileAttribute(8,pictureStatus)
give me TalkException error.
from linepy import *
Traceback (most recent call last):
File "", line 1, in
File "linepy_init_.py", line 1, in
from .client import LineClient
File "linepy\client.py", line 4, in
from .models import LineModels
File "linepy\models.py", line 2, in
from .channel import LineChannel
File "linepy\channel.py", line 2, in
from .client import LineClient
ImportError: cannot import name LineClient
I have two bot ,and one will send join to a group with the ticket and gid which i want to in but it can't work
and I don't know where is wrong here is the code
the first bot
elif text.lower() == 'invite':
ticket = cl.reissueGroupTicket(to)
G = cl.getGroup(to)
if G.preventedJoinByTicket == False:
pass
else:
G.preventedJoinByTicket = False
cl.updateGroup(G)
cl.sendMessage("c02fb6eba0220cef6c6f82d8e15c458b6", "join_"+format(str(ticket))+'_'+G.id)
and here is the second bot
elif "join" in msg.text:
list_ = msg.text.split("_")
try:
cl.acceptGroupInvitationByTicket(list_[1],list_[2])
G = cl.getGroup(list_[1])
G.preventedJoinByTickets = True
cl.updateGroup(G)
except:
cl.sendMessage(msg.to,"error\n"+list_[1]+'\n'+list_[2])
how hard I try but it still doesn't work ,so who can help me fix this ,THX
I got this error, when I try to use getSquare, or getJoinableSquareChats.
SquareException(errorCode=0, reason=u'An unknown error occurred. Please try again later.', errorExtraInfo=None)
getJoinedSquares() is fine and returning correct result.
I tried using this code :
print client.getJoinableSquareChats(mid, limit=3)
already tried to fill mid with user mid or square mid, but get the same result
am I using wrong format or I miss something somewhere?
when i dump op
give me this result
#0 object(Operation) (10)
status => NoneType(None)
checksum => NoneType(None)
param3 => NoneType(None)
param2 => NoneType(None)
param1 => unicode(1) "0"
createdTime => long(1511712185926)
message => object(Message) (12)
contentType => int(0)
hasContent => bool(False)
text => NoneType(None)
id => unicode(13) "7050489046752"
to => unicode(33) "c14b6920b17ab40622eddd4178b532212"
contentPreview => NoneType(None)
location => NoneType(None)
deliveredTime => int(0)
createdTime => long(1511712185884)
_from => unicode(33) "ua3b2f4575c3ff9d01cafa79f471b8fc7"
contentMetadata => dict(1)
['e2eeVersion'] => unicode(1) "1"
toType => int(2)
reqSeq => int(0)
type => int(26)
revision => int(46519)
how to mention like this
@user1
@user2
@user3
Any example to build an echobot if anyone message the bot directly?
Or send a message to someone who have already add the bot as a friend.
Examples here
https://github.com/fadhiilrachman/line-py/tree/master/examples
seems to be bots for group chats.
I had successfully login to line but can't find a way to call timeline function.
Can someone give me a example.
Thanks
Edit:
I found a way. Forgot to read changelog
you can call by
line.getFeed()
line.getHomeProfile()
....
After sending the message several times, a login error occurs and the following error appears.
What does this error message mean?
(login by email and password)
akad.ttypes.TalkException: TalkException(code=20, reason='[UNCAUGHT_INTERNAL_ERROR] [UNCAUGHT_INTERNAL_ERROR] Login from secondary user blocked by userHash + clientType 7381a......', parameterMap=None)
Is there anything way to avoid this error?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.