2.4.2
增加 创建小组(新) http://doc.gzntkj.com/web/#/22?page_id=1767 增加 邀请好友进群组(新) http://doc.gzntkj.com/web/#/22?page_id=1768 增加 设置小组名称说明(新) http://doc.gzntkj.com/web/#/22?page_id=1771
正在显示
2 个修改的文件
包含
48 行增加
和
8 行删除
| @@ -1636,7 +1636,7 @@ class FacebookClient(Client): | @@ -1636,7 +1636,7 @@ class FacebookClient(Client): | ||
| 1636 | try: | 1636 | try: |
| 1637 | return {'success': True, 'data': res['data']} | 1637 | return {'success': True, 'data': res['data']} |
| 1638 | except: | 1638 | except: |
| 1639 | - return {'success': False, "data": []} | 1639 | + return {'success': False, "data": res['errors']} |
| 1640 | 1640 | ||
| 1641 | def FriendingCometFriendRequestDeleteMutation(self, friend_requester_id, source): | 1641 | def FriendingCometFriendRequestDeleteMutation(self, friend_requester_id, source): |
| 1642 | """移除好友请求""" | 1642 | """移除好友请求""" |
| @@ -1650,7 +1650,7 @@ class FacebookClient(Client): | @@ -1650,7 +1650,7 @@ class FacebookClient(Client): | ||
| 1650 | try: | 1650 | try: |
| 1651 | return {'success': True, 'data': res['data']} | 1651 | return {'success': True, 'data': res['data']} |
| 1652 | except: | 1652 | except: |
| 1653 | - return {'success': False, "data": []} | 1653 | + return {'success': False, "data": res['errors']} |
| 1654 | 1654 | ||
| 1655 | def FriendingCometFriendRequestCancelMutation(self, friend_requester_id, source): | 1655 | def FriendingCometFriendRequestCancelMutation(self, friend_requester_id, source): |
| 1656 | """取消好友请求""" | 1656 | """取消好友请求""" |
| @@ -1668,7 +1668,7 @@ class FacebookClient(Client): | @@ -1668,7 +1668,7 @@ class FacebookClient(Client): | ||
| 1668 | try: | 1668 | try: |
| 1669 | return {'success': True, 'data': res['data']} | 1669 | return {'success': True, 'data': res['data']} |
| 1670 | except: | 1670 | except: |
| 1671 | - return {'success': False, "data": []} | 1671 | + return {'success': False, "data": res['errors']} |
| 1672 | 1672 | ||
| 1673 | def FriendingCometFriendRequestSendMutation(self, friend_requester_id, source): | 1673 | def FriendingCometFriendRequestSendMutation(self, friend_requester_id, source): |
| 1674 | """添加好友请求""" | 1674 | """添加好友请求""" |
| @@ -1693,7 +1693,47 @@ class FacebookClient(Client): | @@ -1693,7 +1693,47 @@ class FacebookClient(Client): | ||
| 1693 | try: | 1693 | try: |
| 1694 | return {'success': True, 'data': res['data']} | 1694 | return {'success': True, 'data': res['data']} |
| 1695 | except: | 1695 | except: |
| 1696 | - return {'success': False, "data": []} | 1696 | + return {'success': False, "data": res['errors']} |
| 1697 | + | ||
| 1698 | + def useGroupsCometCreateMutation(self, name, discoverability, members, privacy): | ||
| 1699 | + """创建小组""" | ||
| 1700 | + # name 创建小组名称 | ||
| 1701 | + # discoverability 隐私设置 ANYONE公开 MEMBERS_ONLY非公开 | ||
| 1702 | + # is_forum 未知 | ||
| 1703 | + # members 成员列表 | ||
| 1704 | + # privacy 是否可发现 PUBLIC可发现 PRIVATE不可发现 | ||
| 1705 | + var = {"input": {"bulk_invitee_members": [], "cover_focus": None, "discoverability": discoverability, | ||
| 1706 | + "is_forum": False, | ||
| 1707 | + "members": members, | ||
| 1708 | + "name": name, "privacy": privacy, "referrer": "LHC_COMET_GROUPS_HOME", | ||
| 1709 | + "actor_id": self.uid, "client_mutation_id": self.get_client_mutation_id()}, "scale": 2} | ||
| 1710 | + res = self.graphql_api('useGroupsCometCreateMutation', '3684478318242654', var) | ||
| 1711 | + try: | ||
| 1712 | + return {'success': True, 'data': res['data']} | ||
| 1713 | + except: | ||
| 1714 | + return {'success': False, "data": res['errors']} | ||
| 1715 | + | ||
| 1716 | + def useGroupAddMembersMutation(self, group_id, user_ids): | ||
| 1717 | + """邀请好友进群组""" | ||
| 1718 | + var = {"input": {"email_addresses": [], "group_id": group_id, "source": "comet_group_page", | ||
| 1719 | + "user_ids": user_ids, "actor_id": self.uid, | ||
| 1720 | + "client_mutation_id": self.get_client_mutation_id()}, | ||
| 1721 | + "scale": None} | ||
| 1722 | + res = self.graphql_api('useGroupAddMembersMutation', '4349033738502293', var) | ||
| 1723 | + try: | ||
| 1724 | + return {'success': True, 'data': res['data']} | ||
| 1725 | + except: | ||
| 1726 | + return {'success': False, "data": res['errors']} | ||
| 1727 | + | ||
| 1728 | + def useGroupEditNameAndDescriptionSettingMutation(self, group_id, name, description): | ||
| 1729 | + """设置小组名称说明""" | ||
| 1730 | + var = {"input": {"description": description, "group_id": group_id, "name": name, | ||
| 1731 | + "actor_id": self.uid, "client_mutation_id": self.get_client_mutation_id()}} | ||
| 1732 | + res = self.graphql_api('useGroupEditNameAndDescriptionSettingMutation', '1976417982459057', var) | ||
| 1733 | + try: | ||
| 1734 | + return {'success': True, 'data': res['data']} | ||
| 1735 | + except: | ||
| 1736 | + return {'success': False, "data": res['errors']} | ||
| 1697 | 1737 | ||
| 1698 | def primaryLocation(self): | 1738 | def primaryLocation(self): |
| 1699 | res = self._state._session.get('https://www.facebook.com/primary_location/info/') | 1739 | res = self._state._session.get('https://www.facebook.com/primary_location/info/') |
| @@ -1841,7 +1881,7 @@ class FacebookClient(Client): | @@ -1841,7 +1881,7 @@ class FacebookClient(Client): | ||
| 1841 | try: | 1881 | try: |
| 1842 | return {'success': True, 'data': res['data']} | 1882 | return {'success': True, 'data': res['data']} |
| 1843 | except: | 1883 | except: |
| 1844 | - return {'success': False, "data": []} | 1884 | + return {'success': False, "data": res['errors']} |
| 1845 | 1885 | ||
| 1846 | def cloneMoment(self, story_fbid: str, is_multi_photo=False): | 1886 | def cloneMoment(self, story_fbid: str, is_multi_photo=False): |
| 1847 | if story_fbid.startswith('S:'): | 1887 | if story_fbid.startswith('S:'): |
| @@ -2269,7 +2309,7 @@ class FacebookClient(Client): | @@ -2269,7 +2309,7 @@ class FacebookClient(Client): | ||
| 2269 | try: | 2309 | try: |
| 2270 | return {'success': True, 'data': res['data']['feedback']['reactors']['nodes']} | 2310 | return {'success': True, 'data': res['data']['feedback']['reactors']['nodes']} |
| 2271 | except: | 2311 | except: |
| 2272 | - return {'success': False, "data": []} | 2312 | + return {'success': False, "data": res['errors']} |
| 2273 | else: | 2313 | else: |
| 2274 | try: | 2314 | try: |
| 2275 | f = furl.furl('https://www.facebook.com/ufi/reaction/profile/browser/fetch/') | 2315 | f = furl.furl('https://www.facebook.com/ufi/reaction/profile/browser/fetch/') |
-
请 注册 或 登录 后发表评论