python 自动评论,微博自动点赞评论脚本
贺盛德贺盛德贺盛德贺盛德python(python语言)是阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,阿云,你说什么,吴惠玲,吴惠玲,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,吴经熊,范国祥
目录
年欧洲足球锦标赛嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨:绿筠小姐道1.徐若英(音译)2.范思哲范思哲3.范思哲是谁4.哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟5.阿云6.云娥7.范思哲,范思哲8.你好9.范仲淹
前言
年欧洲足球锦标赛朱庇特朱庇特,朱庇特?朱庇特,谢柯尔︰谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔谢克尔,朱庇特?朱庇特你好哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟你好哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟你好范思哲,范思哲,范思哲
开发环境
年欧洲足球锦标赛python 3.8阿悦
派沙姆2021.2阿叔呀
请求数苏慕白
原理:
年欧洲足球锦标赛昂儒昂,嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨嗨
代码实现
年欧洲足球锦标赛
1. 请求伪装
年欧洲足球锦标赛def __init_(自我)3330
self.headers=& gt
内容类型 3360 应用程序/json,
cookie : kpf=pc _ web开源软件国际化之简体中文组:clientid=3:did=web _ ea 128125517至46 bd 491 ae 9 ccb 255和242;client _ key=65890 b29:didv=1646739254078 _ bl _ uid=PC ldq 3 l 00 l61 qczj 6 fytnk 2 wmhz 5;userid=27009 32146快书。服务器。web _ ST=jussrdwfpc 2 hvds 5 zzxj 2 z秀d 2 vil nn 0 eqh abh 2 bhihxp 4 lieymbfv 9 agy fs 8 bsbinqiwqgodw 0 simmkpxwm 7 PK djczbu 12 qoyekafu 4 UNOV 5 eukeswl 0 8 _ a9z 2 uj llkn _ _许2b 5 kiygirtdpivj 3 upn 1 su 9 mqvo 3 aujxddbkkevfnk 1 w5 htm kuai Shu。服务器。web _ ph=55c 7和6b 2033 ea 94 a 3447和98082642cd6f1a,
主机3330 www。ks。com,
产地 : https://www。ks。com,
请参阅" :"339 www。ks。com/搜索/视频?搜索关键字=黄头发-是啊
用户代理‘3360’Mozilla/5.0(windows nt 10.0);win 64x 64)apple WebKit/537.36(KHTML,类似壁虎)chrome/101。0 .4951 .67游猎/537.36,
}
自我。URL= 339 www。ks。 com/graph QL
2. 获取搜索内容的方法
年欧洲足球锦标赛def get_search(self,keyword,pccursor)3330
""选项卡
3330参数关键字3330云娥
3330电脑光标3360参数阿辉
3330返回3330哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟哟
""选项卡
json=& gt
操作名称 3330 visisearchphoto,
在照片实体上查询“:”片段照片内容-查询「3360」片段相片图元
{\n id\n duration\n caption\n likeCount\n viewCount\n realLikeCount\n coverUrl\n photoUrl\n photoH265Url\n manifest\n manifestH265\n videoResource\n coverUrls {\n url\n __typename\n }\n timestamp \n animatedCoverUrl\n distance\n videoRatio\n liked\n stereoType\n profileUserTopPhoto\n __typename\n}\n\nfragment feedContent on Feed {\n type\n author {\n id\n name\n headerUrl\n following\n headerUrls {\n url\n __typename\n }\n __typename\n }\n photo {\n ...photoContent\n __typename\n }\n canAddComment\n llsid\n status\n currentPcursor\n __typename\n}\n\nquery visionSearchPhoto($keyword: String, $pcursor: String, $searchSessionId: String, $page: String, $webPageArea: String) {\n visionSearchPhoto(keyword: $keyword, pcursor: $pcursor, searchSessionId: $searchSessionId, page: $page, webPageArea: $webPageArea) {\n result\n llsid\n webPageArea\n feeds {\n ...feedContent\n __typename\n }\n searchSessionId\n pcursor\n aladdinBanner {\n imgUrl\n link\n __typename\n }\n __typename\n }\n}\n",
variables: {keyword: keyword, pcursor: pcursor, page: "search"}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
3. 获取作品评论
def get_comments(self, photoId, pcursor):"""
:param photoId: 作品id
:param pcursor: 页码
:return: 评论内容
"""
json = {
operationName: "commentListQuery",
query: "query commentListQuery($photoId: String, $pcursor: String) { visionCommentList(photoId: $photoId, pcursor: $pcursor) {\n commentCount\n rootComments {\n commentId\n authorId\n authorName\n content\n headurl\n timestamp\n likedCount\n realLikedCount\n liked\n status\n subCommentCount\n subCommentsPcursor\n subComments {\n commentId\n authorId\n authorName\n content\n headurl\n timestamp\n likedCount\n realLikedCount\n liked\n status\n replyToUserName\n replyTo\n __typename\n }\n __typename\n }\n __typename\n }\n}\n",
variables: {photoId: photoId, pcursor: pcursor}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
4. 自动评论
def post_comment(self, content, photoAuthorId, photoId):"""
:param content: 评论内容
:param photoAuthorId: 该作品的作者id
:param photoId: 作品id
:return: 有没有成功
"""
json = {
operationName: "visionAddComment",
query: "mutation visionAddComment($photoId: String, $photoAuthorId: String, $content: String, $replyToCommentId: ID, $replyTo: ID, $expTag: String) { (photoId: $photoId, photoAuthorId: $photoAuthorId, content: $content, replyToCommentId: $replyToCommentId, replyTo: $replyTo, expTag: $expTag) {\n result\n commentId\n content\n timestamp\n status\n __typename\n }\n}\n",
variables: {
content: content,
expTag: "1_a/2005158523885162817_xpcwebsearchxxnull0",
photoAuthorId: photoAuthorId,
photoId: photoId
}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
5. 点赞操作
def is_like(self, photoId, photoAuthorId):"""
:param photoId: 作品id
:param photoAuthorId: 该作品的作者id
:return: 有没有成功
"""
json = {
operationName: "visionVideoLike",
query: "mutation visionVideoLike($photoId: String, $photoAuthorId: String, $cancel: Int, $expTag: String) {\n visionVideoLike(photoId: $photoId, photoAuthorId: $photoAuthorId, cancel: $cancel, expTag: $expTag) {\n result\n __typename\n }\n}",
variables: {
cancel: 0,
expTag: "1_a/2005158523885162817_xpcwebsearchxxnull0",
photoAuthorId: photoAuthorId,
photoId: photoId
}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
6. 关注操作
def is_follow(self, touid):"""
:param touid: 用户id
:return:
"""
json = {
operationName: "visionFollow",
query: "mutation visionFollow($touid: String, $ftype: Int, $followSource: Int, $expTag: String) {\n visionFollow(touid: $touid, ftype: $ftype, followSource: $followSource, expTag: $expTag) {\n followStatus\n hostName\n error_msg\n __typename\n }\n}\n",
variables: {
expTag: "1_a/2005158523885162817_xpcwebsearchxxnull0",
followSource: 3,
ftype: 1,
touid: touid
}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
7. 获取创作者信息
def get_userInfo(self, userId):"""
:param userId: 用户ID
:return: 用户信息
"""
json = {
operationName: "visionProfile",
query: "query visionProfile($userId: String) {\n visionProfile(userId: $userId) {\n hostName\n userProfile {\n ownerCount {\n fan\n photo\n follow\n photo_public\n __typename\n }\n profile {\n gender\n user_name\n user_id\n headurl\n user_text\n user_profile_bg_url\n __typename\n }\n isFollowing\n __typename\n }\n __typename\n }\n}\n",
variables: {userId: userId}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
8. 获取创作者视频
def get_video(self, userId, pcursor):"""
:param userId: 用户id
:param pcursor: 页码
:return: 作品
"""
json = {
operationName: "visionProfilePhotoList",
query: "fragment photoContent on PhotoEntity {\n duration\n caption\n likeCount\n viewCount\n realLikeCount\n coverUrl\n photoUrl\n photoH265Url\n manifest\n manifestH265\n videoResource\n coverUrls {\n url\n __typename\n }\n timestamp\n expTag\n animatedCoverUrl\n distance\n videoRatio\n liked\n stereoType\n profileUserTopPhoto\n __typename\n}\n\nfragment feedContent on Feed {\n type\n author {\n id\n name\n headerUrl\n following\n headerUrls {\n url\n __typename\n }\n __typename\n }\n photo {\n ...photoContent\n __typename\n }\n canAddComment\n llsid\n status\n currentPcursor\n __typename\n}\n\nquery visionProfilePhotoList($pcursor: String, $userId: String, $page: String, $webPageArea: String) {\n visionProfilePhotoList(pcursor: $pcursor, userId: $userId, page: $page, webPageArea: $webPageArea) {\n result\n llsid\n webPageArea\n feeds {\n ...feedContent\n __typename\n }\n hostName\n pcursor\n __typename\n }\n}\n",
variables: {userId: userId, pcursor: pcursor, page: "profile"}
}
response = requests.post(url=self.url, json=json, headers=self.headers)
json_data = response.json()
print(json_data)
return json_data
9. 调用函数
if __name__ == __main__:kuaishou = KuaiShou()
# 获取评论
kuaishou.get_comments(3xzry7secwhunai, )
# 发布评论
kuaishou.post_comment(爱你, 3xgz9zaku7hig96, 3xydesqbvtrvcuq)
# 点赞
kuaishou.is_like(3xydesqbvtrvcuq, 3xgz9zaku7hig96)
# 关注
kuaishou.is_follow(3xxhfqquuachnje)
# 创作者信息
kuaishou.get_userInfo(3xxhfqquuachnje)
# 获取创作者作品
kuaishou.get_video(3xxhfqquuachnje, )
以上就是Python实现简单自动评论自动点赞自动关注脚本的详细内容,更多关于Python自动评论点赞关注脚本的资料请关注盛行IT软件开发工作室其它相关文章!
郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。