From cf730ca3d062137e177fd829c469ca352d6b8e8f Mon Sep 17 00:00:00 2001 From: lemon <961222258@qq.com> Date: Fri, 21 Feb 2020 14:01:40 +0800 Subject: [PATCH] 更新加人通道传参数方式 --- lib/facebook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/facebook.py b/lib/facebook.py index d3e5276..af045a9 100644 --- a/lib/facebook.py +++ b/lib/facebook.py @@ -157,7 +157,7 @@ class RequestSource(): def get(cls, channel): if isinstance(channel, str): channel = int(channel) - return cls.const.get(channel, 'people_you_may_know') + return cls.const.get(channel, channel) class FacebookClient(Client): @@ -229,6 +229,7 @@ class FacebookClient(Client): def addFriend(self, fbid, channel=1): how_found = RequestSource.get(channel) + data = { "to_friend": fbid, "action": "add_friend", @@ -238,7 +239,7 @@ class FacebookClient(Client): if how_found == 'profile_friends': data['ref_param'] = 'friends_tab' - if channel == 2: + if how_found == 'profile_button': res = self._payload_post("/ajax/add_friend/action.php", data) else: res = self._payload_post("/ajax/add_friend/action?" + self._to_url_params(data), {}) -- libgit2 0.24.0