From e41e160eb9f91eb1ce1062d22d52911f83b07727 Mon Sep 17 00:00:00 2001 From: chenjunxue <1523825571@qq.com> Date: Mon, 31 Aug 2020 17:40:36 +0800 Subject: [PATCH] 2.3.0 增加添加好朋友,需要确定参数 --- conf/config.yaml | 4 ++-- lib/facebook.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index cef02d9..0d7369c 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -4,5 +4,5 @@ SERVER: reconnect_interval: 3 VERSION: - code: 119 - name: 2.2.9 \ No newline at end of file + code: 120 + name: 2.3.0 \ No newline at end of file diff --git a/lib/facebook.py b/lib/facebook.py index 7d1b00a..60ab96f 100644 --- a/lib/facebook.py +++ b/lib/facebook.py @@ -147,7 +147,7 @@ class FacebookClient(Client): res = self._payload_post('/ajax/messenger/context_banner/?profile_id=%s' % fbid, {'__user': self.uid}) return res - def addFriend(self, fbid, channel=1): + def addFriend(self, fbid, channel=1, **kwargs): how_found = RequestSource.get(channel) data = { "to_friend": fbid, @@ -156,6 +156,7 @@ class FacebookClient(Client): "logging_location": 'friends_center', "floc": 'pymk' } + data.update(kwargs) if how_found == 'profile_friends': data['ref_param'] = 'friends_tab' try: @@ -1535,6 +1536,7 @@ class FacebookClient(Client): 'extragetparams': json.dumps({"__tn__": ",dm-R-R", "eid": rand}) } res = self._get(f'/ajax/hovercard/user.php?id={fbid}', data) + return parse_html.hovercard_get_addfriend(res) def groupMembers(self, group_id, next_url=None): -- libgit2 0.24.0