|
...
|
...
|
@@ -2818,24 +2818,24 @@ class FacebookClient(Client): |
|
|
|
return self.f_res(res)
|
|
|
|
|
|
|
|
def likeProfile(self, fbid, flag=True):
|
|
|
|
# type = 'profile'
|
|
|
|
# action = 'like'
|
|
|
|
# photo_id = self.getAlbumsCover(fbid, type)
|
|
|
|
# if photo_id:
|
|
|
|
# try:
|
|
|
|
# self.graph.put_like(fbid + '_' + photo_id)
|
|
|
|
# return {'success': True, 'photo_id': photo_id}
|
|
|
|
# except GraphAPIError as err:
|
|
|
|
# return {'success': False, 'photo_id': photo_id, 'errors': str(err)}
|
|
|
|
# # return self.feedbackActions(photo_id, action, flag)
|
|
|
|
# else:
|
|
|
|
# return {'success': False, 'errors': "未获取到头像的photo_id"}
|
|
|
|
text = self._state._session.get(f'https://www.facebook.com/{fbid}').text
|
|
|
|
a = re.findall(r'fbid=(.*?)&set=(.*?)","viewer_image"', text)[0]
|
|
|
|
text = self._state._session.get(f'https://www.facebook.com/photo/?fbid={a[0]}&set={a[1]}').text
|
|
|
|
feedback_id = re.findall(r'"feedback":{"id":"(.*?)","can_viewer_react"', text)[0]
|
|
|
|
return self.CometUFIFeedbackReactMutation(feedback_id=feedback_id, encrypted_tracking='',
|
|
|
|
feedback_source='MEDIA_VIEWER')
|
|
|
|
type = 'profile'
|
|
|
|
action = 'like'
|
|
|
|
photo_id = self.getAlbumsCover(fbid, type)
|
|
|
|
if photo_id:
|
|
|
|
try:
|
|
|
|
self.graph.put_like(fbid + '_' + photo_id)
|
|
|
|
return {'success': True, 'photo_id': photo_id}
|
|
|
|
except GraphAPIError as err:
|
|
|
|
return {'success': False, 'photo_id': photo_id, 'errors': str(err)}
|
|
|
|
# return self.feedbackActions(photo_id, action, flag)
|
|
|
|
else:
|
|
|
|
return {'success': False, 'errors': "未获取到头像的photo_id"}
|
|
|
|
# text = self._state._session.get(f'https://www.facebook.com/{fbid}').text
|
|
|
|
# a = re.findall(r'fbid=(.*?)&set=(.*?)","viewer_image"', text)[0]
|
|
|
|
# text = self._state._session.get(f'https://www.facebook.com/photo/?fbid={a[0]}&set={a[1]}').text
|
|
|
|
# feedback_id = re.findall(r'"feedback":{"id":"(.*?)","can_viewer_react"', text)[0]
|
|
|
|
# return self.CometUFIFeedbackReactMutation(feedback_id=feedback_id, encrypted_tracking='',
|
|
|
|
# feedback_source='MEDIA_VIEWER')
|
|
|
|
|
|
|
|
def likeCover(self, fbid, flag=True):
|
|
|
|
type = 'cover'
|
...
|
...
|
|