上一篇文章讲解如何获取快手cookie以及用户信息,这一篇讲解如何通过协议实现关注
协议接口:https://video.kuaishou.com/graphql【POST】
请求格式:Content-type:application/json
请求头参数:Cookie、Referer(必填)
请求参数:
{“operationName”:“visionFollow”,“variables”:{“touid”:“3x4ww5srw5civu4”,“ftype”:1,“followSource”:3,“expTag”:“1_i/2000200228026070817_xpcwebhomexxbrilliant0”},“query”:“mutation visionFollow($touid: String, $ftype: Int, $followSource: Int, $expTag: String) {\n visionFollow(touid: $touid, ftype: $ftype, followSource: $followSource, expTag: $expTag) {\n result\n followStatus\n hostName\n error_msg\n __typename\n }\n}\n”}
参数分析:
其余参数为固定值,唯有touid为变量,其中的followSource之前为2,现在改为3,如果操作失败可以尝试更改为2
一、请求头参数
- Cookie:该值几位登录时获取
- Referer:该值若不携带关注失败,其作用时post的一个校验【Refer:https://video.kuaishou.com/short-video/3xngu4mqz3rpkwa?authorId=3xkq7hiytn8qta9&streamSource=find】
二、请求体
请求体中主要变量为touid,即关注用户的uid,至于uid获取的方式多种多样,下一篇文章讲解用户uid的几种获取方式
三、交流
更多交流,请加群:808798021
扫码加群: