快手视频评论区提取工具,抓取评论内容UID用户信息,采集精准关键词,开源版!

发布时间 2023-11-22 16:20:41作者: 花花java大师

快手评论区里面其实有很多精准的关键词用户,我们可以提取这些关键词用户来实现企业的营销和提取,那么今天我就给大家推荐这么一个软件源码,易语言开发的,用的鱼刺_http模块,和gzip.dll,提取的时候需要用到COOKIE,这个在浏览器开f12刷新,然后选择快手主页,抓包复制cookie就可以了。

软件截图:

 

 

采集效果:

 

 

程序集代码:【完整】

=============================================================

.版本 2

.支持库 spec

.支持库 iext

.支持库 shell

.程序集 窗口程序集_主窗口

.子程序 _主窗口_创建完毕

cookies = YM配置 (“配置”, “cookies”)

' 获取photoId (“https://v.kuaishou.com/qbL7QY ”)

.子程序 获取photoId, 文本型, , '梦远网络工作室版权所有

.参数 URL, 文本型

.局部变量 局_网址, 文本型

.局部变量 局_方式, 文本型

.局部变量 http, WinInet

.局部变量 局_提交数据, 文本型

.局部变量 局_提交协议头, 文本型

.局部变量 局_结果, 字节集

.局部变量 局_返回, 文本型

.局部变量 photoId, 文本型

' https://duanwangzhihuanyuan.bmcx.com/web_system/bmcx_com_www/system/file/duanwangzhihuanyuan/get/?ajaxtimestamp=1656819628038

局_网址 = “https://duanwangzhihuanyuan.bmcx.com/web_system/bmcx_com_www/system/file/duanwangzhihuanyuan/get/?ajaxtimestamp=” + 时间_到时间戳 (取现行时间 (), 假, )

局_方式 = “POST”

' turl=https://v.kuaishou.com/qbL7QY

局_提交数据 = “turl=” + URL + “ ”

http.Auto (真)

http.Open (局_方式, 局_网址)

http.SetRequestHeader (“Accept”, “ */*”, )

http.SetRequestHeader (“Accept-Encoding”, “ gzip, deflate, br”, )

http.SetRequestHeader (“Accept-Language”, “ zh-CN,zh;q=0.9”, )

http.SetRequestHeader (“Connection”, “ keep-alive”, )

http.SetRequestHeader (“Content-Type”, “ application/x-www-form-urlencoded”, )

http.SetRequestHeader (“Host”, “ duanwangzhihuanyuan.bmcx.com”, )

http.SetRequestHeader (“Origin”, “ https://duanwangzhihuanyuan.bmcx.com”, )

http.SetRequestHeader (“Referer”, “ https://duanwangzhihuanyuan.bmcx.com/”, )

http.SetRequestHeader (“Sec-Fetch-Dest”, “ empty”, )

http.SetRequestHeader (“Sec-Fetch-Mode”, “ cors”, )

http.SetRequestHeader (“Sec-Fetch-Site”, “ same-origin”, )

http.SetRequestHeader (“User-Agent”, “ Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0”, )

http.Send (局_提交数据, )

局_结果 = http.GetResponseBody ()

局_返回 = 到文本 (编码_编码转换对象 (局_结果, , , ))

photoId = 文本_取中间 (局_返回, “&photoId=”, “&shareId=”, , , , )

调试输出 (“photoId”, photoId)

返回 (photoId)

' 返回数据被Gzip压缩,调用命令[网页_Gzip解压]需要[Gzip.dll]文件, 将助手根目录下[\gzip.dll]放到源码的根目录才能正常返回数据

.子程序 _按钮1_被单击

.局部变量 photoid, 文本型

.局部变量 返回数据, 文本型

.局部变量 json, 类_json

.局部变量 json2, 类_json

.局部变量 下一页数据, 文本型

.局部变量 i, 整数型

.局部变量 评论, 文本型

.局部变量 UID加密, 文本型

.局部变量 sy, 整数型

.局部变量 采集评论, 逻辑型

.局部变量 byid, 文本型

.局部变量 name, 文本型

.局部变量 sex, 文本型

.局部变量 avatar, 文本型

.局部变量 originUserId, 文本型

.局部变量 result, 文本型

photoid = 获取photoId (编辑框1.内容)

.如果 (photoid ≠ “”)

' 置剪辑板文本 (返回数据)

采集评论 = 真

.判断循环首 (采集评论 = 真)

返回数据 = 获取数据 (photoid, 下一页数据, cookies)

json.解析 (返回数据, , )

下一页数据 = json.取通用属性 (“data.visionCommentList.pcursor”, )

.计次循环首 (json.成员数 (“data.visionCommentList.rootComments”), i)

评论 = json.取通用属性 (“data.visionCommentList.rootComments[” + 到文本 (i - 1) + “].content”, )

UID加密 = json.取通用属性 (“data.visionCommentList.rootComments[” + 到文本 (i - 1) + “].authorId”, )

.计次循环首 (20, ) ' 因为这个获取数据有限制,加上延迟和多次

byid = 取真实uid (UID加密, cookies)

json2.解析 (byid, , )

result = json2.取属性 (“data.result”).取数据文本 ()

name = json2.取通用属性 (“data.userInfo.name”, )

sex = json2.取通用属性 (“data.userInfo.sex”, )

avatar = json2.取通用属性 (“data.userInfo.avatar”, )

originUserId = json2.取属性 (“data.userInfo.originUserId”).取数据文本 ()

json2.清除 ()

.如果真 (result = “1”)

跳出循环 ()

.如果真结束

程序_延时 (3000, )

.计次循环尾 ()

调试输出 (UID加密)

sy = 超级列表框1.插入表项 (, 到文本 (超级列表框1.取表项数 () + 1), , , , )

超级列表框1.置标题 (sy, 1, name)

超级列表框1.置标题 (sy, 2, sex)

超级列表框1.置标题 (sy, 3, UID加密)

超级列表框1.置标题 (sy, 4, originUserId)

超级列表框1.置标题 (sy, 5, 评论)

超级列表框1.保证显示 (sy)

程序_延时 (50, )

.计次循环尾 ()

调试输出 (“下一页数据”, 下一页数据)

.如果真 (下一页数据 = “”)

采集评论 = 假

跳出循环 ()

.如果真结束

程序_延时 (100, )

.判断循环尾 ()

信息框 (“采集完成”, 0, , )

.否则

信息框 (“获取数据失败”, 0, , )

.如果结束

.子程序 获取数据, 文本型

.参数 photoid, 文本型

.参数 pcursor, 文本型, 可空

.参数 cookie, 文本型

.局部变量 局_网址, 文本型

.局部变量 局_方式, 文本型

.局部变量 http, WinInet

.局部变量 局_提交数据, 文本型

.局部变量 局_提交协议头, 文本型

.局部变量 局_提交cookie, 文本型

.局部变量 局_结果, 字节集

.局部变量 局_返回, 文本型

' https://www.kuaishou.com/graphql

局_网址 = “https://www.kuaishou.com/graphql”

局_方式 = “POST”

' {"operationName":"commentListQuery","variables":{"photoId":"3xnegrpxs6s7uwy","pcursor":""},"query":"query commentListQuery($photoId: String, $pcursor: String) {\n visionCommentList(photoId: $photoId, pcursor: $pcursor) {\n commentCount\n pcursor\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"}

局_提交数据 = 文本_替换 (#提交数据, , , , “作品”, photoid, “页数”, pcursor, , , , , , )

' 调试输出 (局_提交数据)

http.Auto (真)

http.Open (局_方式, 局_网址)

http.SetRequestHeader (“accept”, “ */*”, )

http.SetRequestHeader (“Accept-Encoding”, “ gzip, deflate, br”, )

http.SetRequestHeader (“Accept-Language”, “ zh-CN,zh;q=0.9”, )

http.SetRequestHeader (“Connection”, “ keep-alive”, )

http.SetRequestHeader (“Content-Length”, “ ” + 到文本 (取文本长度 (局_提交数据)), )

http.SetRequestHeader (“content-type”, “ application/json”, )

http.SetRequestHeader (“Host”, “ www.kuaishou.com”, )

http.SetRequestHeader (“Origin”, “ https://www.kuaishou.com”, )

' http.SetRequestHeader (“Referer”, “ https://www.kuaishou.com/short-video/3xnegrpxs6s7uwy?userId=3x9rqfttg98vjik”, ) ' 可有可没有

http.SetRequestHeader (“Sec-Fetch-Dest”, “ empty”, )

http.SetRequestHeader (“Sec-Fetch-Mode”, “ cors”, )

http.SetRequestHeader (“Sec-Fetch-Site”, “ same-origin”, )

http.SetRequestHeader (“User-Agent”, “ Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0”, )

局_提交cookie = cookie

http.SetCookie (局_提交cookie)

http.Send (局_提交数据, )

局_结果 = http.GetResponseBody ()

局_返回 = 到文本 (编码_编码转换对象 (局_结果, , , ))

返回 (局_返回)

' 返回数据被Gzip压缩,调用命令[网页_Gzip解压]需要[Gzip.dll]文件, 将助手根目录下[\gzip.dll]放到源码的根目录才能正常返回数据

.子程序 取真实uid, 文本型, , 本命令由【精易网页调试助手】生成,请配合 [精易模块] 与 [鱼刺类_Httpv5.0] 使用。

.参数 加密uid, 文本型

.参数 ck, 文本型

.局部变量 局_网址, 文本型

.局部变量 局_方式, 文本型

.局部变量 http, WinInet

.局部变量 局_提交协议头, 文本型

.局部变量 局_提交cookie, 文本型

.局部变量 局_结果, 字节集

.局部变量 局_返回, 文本型

' https://live.kuaishou.com/live_api/baseuser/userinfo/byid?principalId=3xgei3d2xw65yyq

局_网址 = “https://live.kuaishou.com/live_api/baseuser/userinfo/byid?principalId=” + 加密uid

局_方式 = “GET”

http.Auto (真)

http.Open (局_方式, 局_网址)

http.SetRequestHeader (“Accept”, “ application/json, text/plain, */*”, )

http.SetRequestHeader (“Accept-Encoding”, “ gzip, deflate, br”, )

http.SetRequestHeader (“Accept-Language”, “ zh-CN,zh;q=0.9”, )

http.SetRequestHeader (“baggage”, “ sentry-environment=prod,sentry-release=e216db5”, )

http.SetRequestHeader (“Connection”, “ keep-alive”, )

http.SetRequestHeader (“Host”, “ live.kuaishou.com”, )

http.SetRequestHeader (“Referer”, “ https://live.kuaishou.com/profile/” + 加密uid, )

http.SetRequestHeader (“Sec-Fetch-Dest”, “ empty”, )

http.SetRequestHeader (“Sec-Fetch-Mode”, “ cors”, )

http.SetRequestHeader (“Sec-Fetch-Site”, “ same-origin”, )

http.SetRequestHeader (“User-Agent”, “ Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0”, )

局_提交cookie = ck

http.SetCookie (局_提交cookie)

http.Send (, )

局_结果 = http.GetResponseBody ()

局_返回 = 到文本 (编码_编码转换对象 (局_结果, , , ))

调试输出 (局_返回)

返回 (局_返回)

.子程序 _按钮2_被单击

.如果真 (输入框 (“请输入快手网页版cookies”, “请输入快手网页版cookies”, , cookies, , ))

YM写配置 (“配置”, “cookies”, cookies)

.如果真结束

.子程序 YM写配置

.参数 节名, 文本型

.参数 配置名, 文本型

.参数 值, 文本型

写配置项 (取特定目录 (#我的文档) + “/amy.ini”, 节名, 配置名, 值)

.子程序 YM配置, 文本型

.参数 节名, 文本型

.参数 配置名, 文本型

返回 (读配置项 (取特定目录 (#我的文档) + “/amy.ini”, 节名, 配置名, ))

=======================================================