鱼C论坛

 找回密码
 立即注册
查看: 1984|回复: 10

网易云音乐爬虫时,获取到不到R_SO_4_520458203?csrf_token=信息

[复制链接]
发表于 2020-8-25 15:47:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
在网易云音乐界面,查看元数时,XHR里面怎么没有R_SO_4_520458203?csrf_token=
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-8-25 15:49:45 | 显示全部楼层
你要爬啥东西
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-8-25 15:52:36 | 显示全部楼层

[爬虫] 爬取网易云音乐的精彩评论
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 15:53:58 | 显示全部楼层
lyl-spencer 发表于 2020-8-25 15:52
[爬虫] 爬取网易云音乐的精彩评论

网易云的评论在一个叫get?csrf_token=的数据包里,里面data包含的hotcommet就是评论
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-8-25 15:59:04 | 显示全部楼层
1q23w31 发表于 2020-8-25 15:53
网易云的评论在一个叫get?csrf_token=的数据包里,里面data包含的hotcommet就是评论

{comments: [{,…}, {,…}, {,…}, {,…},…], currentComment: null, totalCount: 289104, hasMore: false,…} 里面是这样的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 16:00:14 | 显示全部楼层
lyl-spencer 发表于 2020-8-25 15:59
{comments: [{,…}, {,…}, {,…}, {,…},…], currentComment: null, totalCount: 289104, hasMore: fal ...


点卡这个json
{"code":200,"data":{"comments":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":2067680328,"userType":0,"nickname":"帅拒绝赞美","avatarUrl":"https://p1.music.126.net/RLeBJe4D1ZzUtltxfoKDMg==/109951163250239066.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":510441866,"userType":0,"nickname":"LGHH丶","avatarUrl":"https://p1.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433742122,"content":"谁来这里试调音的\uD83E\uDD29\uD83E\uDD29\uD83E\uDD29","status":0,"expressionUrl":null}],"commentId":3433766936,"content":"一样,看抖音上来的","status":0,"time":1598341913770,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433742122,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1789238860,"userType":0,"nickname":"别再把我搞丢啦","avatarUrl":"https://p1.music.126.net/gyuf0VjeoUEoTD96CzBxeQ==/109951165253409971.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":510441866,"userType":0,"nickname":"LGHH丶","avatarUrl":"https://p2.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433742122,"content":"谁来这里试调音的\uD83E\uDD29\uD83E\uDD29\uD83E\uDD29","status":0,"expressionUrl":null}],"commentId":3433750062,"content":"我我!","status":0,"time":1598341904662,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433742122,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":575832630,"userType":0,"nickname":"發財佳欣_","avatarUrl":"https://p2.music.126.net/4kUh7KtW1jPqOVt3I-i3xw==/109951165078102294.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1735974734,"userType":0,"nickname":"大胡子-哈登_","avatarUrl":"https://p2.music.126.net/IRdQ4kWIGIDQg3YAhQ1p-A==/109951164282529580.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433743099,"content":"今天分了……昨晚还给她发了520.00元来着……唉……好难受……不知道怎么说了","status":0,"expressionUrl":null}],"commentId":3433738323,"content":"好好的哦","status":0,"time":1598341895334,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433743099,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":510441866,"userType":0,"nickname":"LGHH丶","avatarUrl":"https://p2.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433742122,"content":"谁来这里试调音的\uD83E\uDD29\uD83E\uDD29\uD83E\uDD29","status":0,"time":1598341878713,"likedCount":8,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":2,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":null,"musicPackage":{"vipCode":220,"rights":true},"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":136743020,"userType":0,"nickname":"songyvacwan","avatarUrl":"https://p2.music.126.net/0XV6XKSAqpULOZQge3kaaw==/109951165217782783.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":10,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433739197,"content":"赞赞新动态照片","status":0,"time":1598341853867,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":506397590,"userType":0,"nickname":"你好特别__vkCs","avatarUrl":"https://p2.music.126.net/F_S4XT_O7nGXXY0V24FqLQ==/109951165268367543.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433750050,"content":"你不能同时为两个女孩撑伞 我已经浑身湿透了","status":0,"time":1598341841415,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":376603506,"userType":0,"nickname":"还是叫我小李","avatarUrl":"https://p2.music.126.net/pt86cl6SoGzPjeHqGTjhTw==/109951165119620358.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":531367535,"userType":0,"nickname":"Tottors-","avatarUrl":"https://p2.music.126.net/DIJWk0-EAny5YYgwTsM-Ww==/109951164959303528.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beRepliedCommentId":3433676673,"content":"就没有抖音调音来的么","status":0,"expressionUrl":null}],"commentId":3433721409,"content":"来了来了","status":0,"time":1598341822946,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433676673,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1735974734,"userType":0,"nickname":"大胡子-哈登_","avatarUrl":"https://p2.music.126.net/IRdQ4kWIGIDQg3YAhQ1p-A==/109951164282529580.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433743099,"content":"今天分了……昨晚还给她发了520.00元来着……唉……好难受……不知道怎么说了","status":0,"time":1598341818125,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":1,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1892863797,"userType":0,"nickname":"Ethcydivision","avatarUrl":"https://p2.music.126.net/859KjU2Wxd61lFUesOcFZg==/109951165255227359.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433693591,"content":"先爱己而后爱人❤️","status":0,"time":1598341792819,"likedCount":1,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":486365128,"userType":0,"nickname":"北宫米酒","avatarUrl":"https://p2.music.126.net/VnZiScyynLG7atLIZ2YPkw==/18686200114669622.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433711519,"content":"加油就完了","status":0,"time":1598341791917,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1746132213,"userType":0,"nickname":"再见即是离别_","avatarUrl":"https://p2.music.126.net/O3KheexbWLIwic6LmL9Kmw==/109951165213479411.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433732353,"content":"好久不见 我的头发剪短啦 也尝试过很多风格 还有还有我已经不记得你的声音啦 不出意外 我们不会见面啦","status":0,"time":1598341790173,"likedCount":1,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":357107244,"userType":0,"nickname":"至少我知道你的名字","avatarUrl":"https://p2.music.126.net/zYdTQqhBqDS-Io2Gzv7ceg==/109951163723046304.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433686704,"content":"好的知道了","status":0,"time":1598341786724,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":309791722,"userType":10,"nickname":"云音乐多多","avatarUrl":"https://p2.music.126.net/HSnb96jWihYF4m8_IY_IGw==/109951163188670265.jpg","authStatus":1,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":256914881,"userType":0,"nickname":"1205_lin","avatarUrl":"https://p2.music.126.net/fJ2qC1UwiRL7YrACs5uDsQ==/109951165171996941.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beRepliedCommentId":3431439203,"content":"爱而不得本就是世间常态","status":0,"expressionUrl":null}],"commentId":3433712458,"content":"缘深缘浅 且行且珍惜","status":0,"time":1598341774768,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3431439203,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":1705633366,"userType":0,"nickname":"王意远","avatarUrl":"https://p1.music.126.net/c3YsPNjDc-mHm4KJLTECQA==/109951165152744970.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433745109,"content":"再见面时的尴尬就是还未消散的爱","status":0,"time":1598341732867,"likedCount":5,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1437225348,"userType":0,"nickname":"他以温柔落幕-","avatarUrl":"https://p1.music.126.net/MFxdZmY2RXk1C3BwdKqCdQ==/109951165260812121.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":589855382,"userType":0,"nickname":"你若a安好","avatarUrl":"https://p1.music.126.net/YCaRUABY_QV8PZ4HcB_Nxw==/109951164894195668.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433725355,"content":"你也有哦","status":0,"expressionUrl":null}],"commentId":3433748086,"content":"蟹蟹,一下暖了起来[亲亲]","status":0,"time":1598341724068,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433767866,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":1513889466,"userType":0,"nickname":"昼夜午晌","avatarUrl":"https://p1.music.126.net/fLKjX4E_6EEeERLmUyp0_Q==/109951165263515483.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433766904,"content":"不是吧,那么好听的歌开心点不行吗","status":0,"time":1598341721715,"likedCount":3,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":646873190,"userType":0,"nickname":"TA-TPP","avatarUrl":"https://p1.music.126.net/DC-i6jTWE4vPnzaicTHZvg==/109951165248725077.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1550980860,"userType":0,"nickname":"玊尔112","avatarUrl":"https://p1.music.126.net/4jqB2o9G2zjk6QtlJyqcSQ==/109951165268356226.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433686680,"content":"集美们 打开鲸鱼音效:超重低音 调节均衡器 —低音,环绕深度,环绕强度调至最大  高音调至百分之十  环境音效设为浴室。  于是你就坐在了演唱会现场","status":0,"expressionUrl":null}],"commentId":3433717378,"content":"哈哈哈哈哈哈哈哈 我刚从微博学来调完 就看到你的评论了","status":0,"time":1598341720755,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":3433686680,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":3252696674,"userType":0,"nickname":"Pt苏晚晚","avatarUrl":"https://p1.music.126.net/A374zSeZX5FWFSKROz99oQ==/109951164795534444.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433688644,"content":"RPH等我","status":0,"time":1598341715876,"likedCount":1,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1778317792,"userType":0,"nickname":"木子回冬12138","avatarUrl":"https://p1.music.126.net/0zu44n2-RVm8HRXvolZfyA==/109951163895097275.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3433719441,"content":"会有的,加油. 我会拥有","status":0,"time":1598341708575,"likedCount":0,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":null,"musicPackage":{"vipCode":220,"rights":true},"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":290939162,"userType":0,"nickname":"丨Groot丨","avatarUrl":"https://p1.music.126.net/39eXGQ7bZR5-0-pGHZOkRA==/109951164637523107.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":10,"remarkName":null,"isHug":false},"beReplied":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1550980860,"userType":0,"nickname":"玊尔112","avatarUrl":"https://p1.music.126.net/4jqB2o9G2zjk6QtlJyqcSQ==/109951165268356226.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beRepliedCommentId":3433686680,"content":"集美们 打开鲸鱼音效:超重低音 调节均衡器 —低音,环绕深度,环绕强度调至最大  高音调至百分之十  环境音效设为浴室。  于是你就坐在了演唱会现场","status":0,"expressionUrl":null}],"commentId":3433759991,"content":"抖音过来的吧[汗]","status":0,"time":1598341703109,"likedCount":1,"liked":false,"expressionUrl":null,"parentCommentId":3433686680,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":0,"comments":null,"showReplyCount":false,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null}],"currentComment":null,"totalCount":233993,"hasMore":false,"cursor":"1598341703109","sortType":3,"sortTypeList":[{"sortType":99,"sortTypeName":"按推荐排序","target":"order_by_alg"},{"sortType":2,"sortTypeName":"按热度排序","target":"order_by_hot"},{"sortType":3,"sortTypeName":"按时间排序","target":"order_by_time"}],"orderType":null,"hotComments":[{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":297502090,"userType":0,"nickname":"Xinyiiiiiiii","avatarUrl":"https://p1.music.126.net/7_jE-uREJghDQkUzDM-e4w==/109951165244826373.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426232676,"content":"“最遗憾的就是..我输在了你不爱我”","status":0,"time":1597852804536,"likedCount":137927,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":{"id":62200,"imageUrl":"http://p1.music.126.net/aJwKd_KM-tJlhaX2Clju1w==/109951164988688246.jpg"},"showFloorComment":{"replyCount":2172,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":1},"relationTag":null,"anonym":0,"userId":2031528792,"userType":4,"nickname":"不是赵楠","avatarUrl":"https://p2.music.126.net/J7alt7auzKF3R42pdf66lg==/109951165251605260.jpg","authStatus":1,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426255491,"content":"天空一直在,只是星星去了又来。","status":0,"time":1597852805898,"likedCount":89435,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":1054,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":1334483012,"userType":4,"nickname":"717的阿玄","avatarUrl":"https://p2.music.126.net/XZ32RnPFDC8TJKvM6d4ToA==/109951164830664352.jpg","authStatus":1,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426245484,"content":"“你别卷入世俗 我别沉迷初遇”——薛之谦。","status":0,"time":1597852811634,"likedCount":76901,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":{"id":72200,"imageUrl":"http://p1.music.126.net/i8_fvsYz1J-y_znAlIeD6A==/109951165252354104.jpg"},"showFloorComment":{"replyCount":356,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":1294725966,"userType":0,"nickname":"十分ovo","avatarUrl":"https://p2.music.126.net/U5QEZ7EEluguCreZ5CN07w==/109951165234868996.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426294072,"content":"不爱我 不是你的过错 是我的弄巧成拙","status":0,"time":1597852819219,"likedCount":54011,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":{"id":25000,"imageUrl":"http://p1.music.126.net/Q0hDpVI6q5nfkGpcrTUKdw==/109951164219709711.jpg"},"showFloorComment":{"replyCount":277,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":null,"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":1744611180,"userType":0,"nickname":"记得好好鬼混","avatarUrl":"https://p2.music.126.net/JnfiPOclsuG009IamlzTvw==/109951164915691703.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426348580,"content":"谁都有爱而不得的人,遗憾也是庆幸","status":0,"time":1597854702153,"likedCount":38734,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":247,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":607001887,"userType":0,"nickname":"今天都吃了什么呀","avatarUrl":"https://p2.music.126.net/88evNcfSnCAusPB1JEFmIQ==/109951165251736868.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426245531,"content":"哥啊 喜欢你五年了 今年遇到了一个很喜欢我的男孩子 我们今天就半年啦 不知道为什么这么巧 昨天就看见你发微博说出新歌了 他很好噢 像你一样很温柔很温柔 他也很喜欢你 有机会的话 我们一起来看你的演唱会 告诉你 已经喜欢你好多年了","status":0,"time":1597852838699,"likedCount":14003,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":260,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":1},"relationTag":null,"anonym":0,"userId":118435316,"userType":0,"nickname":"是一眼到老啊","avatarUrl":"https://p2.music.126.net/RM7yhoZ9OGrpjVA88DthWw==/109951165168867193.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426338624,"content":"小时候 我们拿这一朵花 问:\n你爱我 你不爱我 你爱我...\n长大后 我们会一边生活 一边等你...","status":0,"time":1597854700911,"likedCount":7450,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":20,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":539607720,"userType":0,"nickname":"乖乖要早睡鸭","avatarUrl":"https://p2.music.126.net/tK7W66IokUAswLJy5o2jdg==/109951165003973368.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3427010108,"content":"开始以为你只是不懂得爱人\n后来才发现 你只是不爱我","status":0,"time":1597904439133,"likedCount":6961,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":36,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":624525979,"userType":0,"nickname":"Lil-gesong","avatarUrl":"https://p2.music.126.net/-jJxfTcXz7yHn6nrIG-ZZQ==/109951165252096215.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426353226,"content":"“不爱我”没有前奏,就像你不爱我毫无征兆","status":0,"time":1597853848017,"likedCount":6530,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":36,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1403864243,"userType":0,"nickname":"holivr","avatarUrl":"https://p2.music.126.net/C4-Rm5RuZommWMzDHANKvw==/109951164892106461.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426332433,"content":"你还好吗\n我们的故事 未完待续\n也永远不会迎来结局","status":0,"time":1597853838204,"likedCount":5697,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":20,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":439780014,"userType":0,"nickname":"橘子-------------","avatarUrl":"https://p2.music.126.net/FPqwl66jxqnI4dJteVFjeA==/109951165185978331.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3427178480,"content":"一切努力皆有可能 唯有爱情靠的是运气","status":0,"time":1597915664589,"likedCount":5593,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":11,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":{"vipCode":100,"rights":true},"musicPackage":null,"redVipAnnualCount":1},"relationTag":null,"anonym":0,"userId":354868458,"userType":4,"nickname":"KIND_CQ","avatarUrl":"https://p2.music.126.net/FCr5etr6-wXxcBhlt1BF5g==/109951164888228545.jpg","authStatus":1,"expertTags":null,"experts":null,"vipType":11,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3431589282,"content":"错的人不会因为熬多一点时间就变成适合 ​​​\n\n","status":0,"time":1598192006049,"likedCount":5015,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":{"id":5002,"imageUrl":"http://p1.music.126.net/tFjGw0GRZ-Oyf6r5vH4kFQ==/109951163313123168.jpg"},"showFloorComment":{"replyCount":5,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":{"associator":null,"musicPackage":{"vipCode":220,"rights":true},"redVipAnnualCount":-1},"relationTag":null,"anonym":0,"userId":474491547,"userType":0,"nickname":"甜美小怡-","avatarUrl":"https://p2.music.126.net/AUbTLS4iTnwdMUpLruR8ww==/109951165246076874.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":10,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3427490388,"content":"王怀钏我真的真的真的不想错过你","status":0,"time":1597930488914,"likedCount":4820,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":8,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1312391018,"userType":0,"nickname":"小熊可可爱茶","avatarUrl":"https://p2.music.126.net/2sAYiZ3Vlr7ut0RlTKT89A==/109951165157410798.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426259516,"content":"“你用温柔形容薛之谦,而我用薛之谦形容温柔”","status":0,"time":1597852825388,"likedCount":4573,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":18,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null},{"user":{"locationInfo":null,"liveInfo":null,"followed":false,"vipRights":null,"relationTag":null,"anonym":0,"userId":1818214401,"userType":0,"nickname":"舒词__KSz","avatarUrl":"https://p2.music.126.net/MgrkOWW6Vwp4GxSjTGeymQ==/109951165256246092.jpg","authStatus":0,"expertTags":null,"experts":null,"vipType":0,"remarkName":null,"isHug":false},"beReplied":null,"commentId":3426286540,"content":"我故意不理你的时候 比你不理我难受多了.","status":0,"time":1597853198995,"likedCount":4244,"liked":false,"expressionUrl":null,"parentCommentId":0,"repliedMark":false,"pendantData":null,"showFloorComment":{"replyCount":20,"comments":null,"showReplyCount":true,"topCommentIds":null,"target":null},"decoration":{"repliedByAuthorCount":0},"commentLocationType":0,"args":null,"tag":{"datas":null,"relatedCommentIds":null},"source":null}]}}
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 16:01:44 | 显示全部楼层
lyl-spencer 发表于 2020-8-25 15:59
{comments: [{,…}, {,…}, {,…}, {,…},…], currentComment: null, totalCount: 289104, hasMore: fal ...

点到preview,在里面可以查看这个json的内容
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 16:02:34 | 显示全部楼层
lyl-spencer 发表于 2020-8-25 15:59
{comments: [{,…}, {,…}, {,…}, {,…},…], currentComment: null, totalCount: 289104, hasMore: fal ...

2020-8-25 16-2-14.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 16:03:53 | 显示全部楼层
lyl-spencer 发表于 2020-8-25 15:59
{comments: [{,…}, {,…}, {,…}, {,…},…], currentComment: null, totalCount: 289104, hasMore: fal ...

commetnt不是热评,hotcomment是热评,看你要哪个
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-8-25 17:13:34 | 显示全部楼层
import requests, bs4
import random, datetime
import base64
from binascii import hexlify
from Crypto.Cipher import AES
import json


class WangYiYun():
    def __init__(self):
        self.url = 'https://music.163.com'
        self.headers = {
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'}
        self.modulus = "00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7"
        self.nonce = '0CoJUm6Qyw8W8jud'
        self.pubKey = '010001'

    def get_Top(self):
        '''
        :return: 返回所有排行榜的字典列表
        '''
        res = requests.get('https://music.163.com/discover/toplist?', headers=self.headers)
        s = bs4.BeautifulSoup(res.text, 'html.parser')
        s=s.find_all('li', class_='mine')
        ls=[]
        for item in s:
            d=dict.fromkeys(('title','id'))
            d['title']=item.div.p.a.text
            d['id'] = item['data-res-id']
            ls.append(d)
        return ls

    def get_TopList(self, id):
        '''
        根据排行榜id获取里面排行榜的音乐
        :param url: id 网址里面id的值
        :return: 返回值如果有多个结果则是字典类型的列表
        '''
        res = requests.get(f'https://music.163.com/discover/toplist?id={id}', headers=self.headers)

        s = bs4.BeautifulSoup(res.text, 'html.parser')
        s = s.find('textarea', id="song-list-pre-data")
        j = json.loads(s.text)
        ls = []
        for item in j:
            d = dict.fromkeys(('name', 'id', 'artists', 'time'))
            d['name'] = item['name']
            d['id'] = item['id']
            d['artists'] = item['artists']
            time = datetime.timedelta(seconds=int(int(item['duration']) / 1000))
            d['time'] = str(time)
            ls.append(d)
        return ls

    def search_music(self, s):
        '''
        通过关键字搜索音乐
        :param s: 关键字
        :return: 返回值如果有多个结果则是字典类型的列表
        '''
        text = {"hlpretag": "<span class='s-fc7'>", "hlposttag": "</span>", "s": s, "type": "1", "offset": "0",
                "total": "true", "limit": "100", "csrf_token": ""}
        secKey = self.getRandom()
        text = json.dumps(text)
        params = self.aesEncrypt(self.aesEncrypt(text, self.nonce), secKey)
        encSecKey = self.rsaEncrypt(secKey)
        data = {'params': params,
                'encSecKey': encSecKey
                }
        res = requests.post(f'https://music.163.com/weapi/cloudsearch/get/web', data=data,
                            headers=self.headers)
        j = json.loads(res.text)
        j = j['result']['songs']
        ls = []
        for item in j:
            d = dict.fromkeys(('name', 'ar', 'al', 'id'))
            d['name'] = item['name']  # 歌名
            d['ar'] = item['ar']  # 作者列表
            d['al'] = item['al']  # 专辑
            d['id'] = item['id']  # 歌曲播放页面id
            ls.append(d)
        return ls

    def get_music_url(self, id):
        '''
        通过音乐id获取真实下载和播放链接
        :param s: 歌曲id 文本型  可以有多个 用逗号分隔
        :return: 返回值如果有多个结果则是字典类型的列表
        '''
        text = {"ids": f"[{id}]", "level": "standard", "encodeType": "aac", "csrf_token": ""}
        secKey = self.getRandom()
        text = json.dumps(text)
        params = self.aesEncrypt(self.aesEncrypt(text, self.nonce), secKey)
        encSecKey = self.rsaEncrypt(secKey)
        data = {'params': params,
                'encSecKey': encSecKey
                }
        try:
            res = requests.post('https://music.163.com/weapi/song/enhance/player/url/v1?csrf_token=', data=data,headers=self.headers)
            j = json.loads(res.text)
            return j['data'][0]['url']
        except:
            return ""
    def getRandom(self):
        '''
        取16位的随机字符
        :return: 返回一串16位的随机字符
        '''
        str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
        random_str = '';
        for i in range(16):
            index = random.randint(0, len(str) - 1);
            random_str += str[index];
        return random_str;

    def aesEncrypt(self, text, secKey):
        '''
        aes加密
        :param text: 要加密的文本
        :param secKey: 秘钥
        :return: 加密后的文本
        '''
        pad = 16 - len(text) % 16
        text = text + pad * chr(pad)
        text = text.encode('utf-8')
        encryptor = AES.new(bytes(secKey.encode('utf-8')), 2, b'0102030405060708')
        ciphertext = encryptor.encrypt(text)
        ciphertext = base64.b64encode(ciphertext).decode("utf-8")
        return ciphertext

    def rsaEncrypt(self, text):  # text是16位的随机字符串
        '''
        rsa加密
        :param text: 要加密的文本
        :return: 返回加密后的文本
        '''
        text = text[::-1];
        result = pow(int(hexlify(text.encode()), 16), int(self.pubKey, 16), int(self.modulus, 16));
        return format(result, 'x').zfill(131);

    def getParam(self, text):
        '''
        通过加密后的文本运算得出提交的params和encSecKey数据
        :param text:
        :return: 返回需要提交的params和encSecKey数据
        '''
        secKey = self.getRandom()
        params = self.aesEncrypt(self.aesEncrypt(text, secKey), self.nonce)
        encSecKey = self.rsaEncrypt(secKey, self.pubKey, self.modulus)
        return params, encSecKey
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-8-26 10:32:49 | 显示全部楼层
已解决 感谢各位
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-19 02:57

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表