|
...
|
...
|
@@ -1636,7 +1636,7 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def FriendingCometFriendRequestDeleteMutation(self, friend_requester_id, source):
|
|
|
|
"""移除好友请求"""
|
|
...
|
...
|
@@ -1650,7 +1650,7 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def FriendingCometFriendRequestCancelMutation(self, friend_requester_id, source):
|
|
|
|
"""取消好友请求"""
|
|
...
|
...
|
@@ -1668,7 +1668,7 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def FriendingCometFriendRequestSendMutation(self, friend_requester_id, source):
|
|
|
|
"""添加好友请求"""
|
|
...
|
...
|
@@ -1693,7 +1693,47 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def useGroupsCometCreateMutation(self, name, discoverability, members, privacy):
|
|
|
|
"""创建小组"""
|
|
|
|
# name 创建小组名称
|
|
|
|
# discoverability 隐私设置 ANYONE公开 MEMBERS_ONLY非公开
|
|
|
|
# is_forum 未知
|
|
|
|
# members 成员列表
|
|
|
|
# privacy 是否可发现 PUBLIC可发现 PRIVATE不可发现
|
|
|
|
var = {"input": {"bulk_invitee_members": [], "cover_focus": None, "discoverability": discoverability,
|
|
|
|
"is_forum": False,
|
|
|
|
"members": members,
|
|
|
|
"name": name, "privacy": privacy, "referrer": "LHC_COMET_GROUPS_HOME",
|
|
|
|
"actor_id": self.uid, "client_mutation_id": self.get_client_mutation_id()}, "scale": 2}
|
|
|
|
res = self.graphql_api('useGroupsCometCreateMutation', '3684478318242654', var)
|
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def useGroupAddMembersMutation(self, group_id, user_ids):
|
|
|
|
"""邀请好友进群组"""
|
|
|
|
var = {"input": {"email_addresses": [], "group_id": group_id, "source": "comet_group_page",
|
|
|
|
"user_ids": user_ids, "actor_id": self.uid,
|
|
|
|
"client_mutation_id": self.get_client_mutation_id()},
|
|
|
|
"scale": None}
|
|
|
|
res = self.graphql_api('useGroupAddMembersMutation', '4349033738502293', var)
|
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def useGroupEditNameAndDescriptionSettingMutation(self, group_id, name, description):
|
|
|
|
"""设置小组名称说明"""
|
|
|
|
var = {"input": {"description": description, "group_id": group_id, "name": name,
|
|
|
|
"actor_id": self.uid, "client_mutation_id": self.get_client_mutation_id()}}
|
|
|
|
res = self.graphql_api('useGroupEditNameAndDescriptionSettingMutation', '1976417982459057', var)
|
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def primaryLocation(self):
|
|
|
|
res = self._state._session.get('https://www.facebook.com/primary_location/info/')
|
|
...
|
...
|
@@ -1841,7 +1881,7 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
|
|
|
|
def cloneMoment(self, story_fbid: str, is_multi_photo=False):
|
|
|
|
if story_fbid.startswith('S:'):
|
|
...
|
...
|
@@ -2269,7 +2309,7 @@ class FacebookClient(Client): |
|
|
|
try:
|
|
|
|
return {'success': True, 'data': res['data']['feedback']['reactors']['nodes']}
|
|
|
|
except:
|
|
|
|
return {'success': False, "data": []}
|
|
|
|
return {'success': False, "data": res['errors']}
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
f = furl.furl('https://www.facebook.com/ufi/reaction/profile/browser/fetch/')
|
...
|
...
|
|