简单找出哔哩哔哩的Api

释放双眼,带上耳机,听听看~!

前言

用到的软件:PC端Chrome,如果没有电脑可以试试安卓的神奇浏览器(要有能调出开发者工具的)

开始

这里我们以抓取哔哩哔哩视频信息接口为例

  1. 打开chrome,按下F12,然后访问哔哩哔哩任意一视频链接例如:https://www.bilibili.com/video/BV12541147c6
  2. 然后点击开发者的->networkhttps://assets.zhuchunshu.com/wp-content/uploads/2020/04/2929663461.png
  3. 找出每一个返回json数据的网址,例如:https://api.bilibili.com/x/web-interface/view?bvid=BV号 这个就是获取当前视频信息的网址,访问就以json格式输出当前视频所有信息 例如我们访问https://api.bilibili.com/x/web-interface/view?bvid=BV12541147c6 就输出

    {"code":0,"message":"0","ttl":1,"data":{"bvid":"BV12541147c6","aid":455084926,"videos":1,"tid":27,"tname":"综合","copyright":1,"pic":"http://i1.hdslb.com/bfs/archive/5a16627d6565c37fa3d3ff404ce9c9c2230869bb.jpg","title":"我算出了百机操演有多少个傀儡,b站第一人","pubdate":1585887009,"ctime":1585735111,"desc":"【b站第一人】系列视频全在这儿啦,点个三连这次一定~\n第17期:BV1q7411d7KH  我算出了纲手的身材数据\n第16期:BV1QE411G7Tq  我算出了忍者联军有多少人\n第15期:BV1f7411c7CG   我又又做出了中忍考试试题\n第14期:BV1p741147J6   我做出了中忍考试试题\n第13期:BV1MJ411E7My 我算出了真数千手的高度和数量\n第12期:BV1wJ411J7JK   我算出了2233娘的身材数据\n第11期:BV1fJ411t7HU   我找到了最想起舞的那个人\n第10期:BV12J411D7JB   木叶村城区面积有多大\n第9期:BV14E41187Am 斑召唤的陨石有多大?\n第8期:BV1kE411X74T  我就是最了解品如的男人?\n第7期:BV1iJ411A7BU   我找到了品如最喜欢的衣服\n第6期:BV1G4411m79P 揭秘角都如何八百里外扔手里剑\n第5期:BV1A4411Q7c8  六千亿张起爆符怎样才能炸死带土\n第4期:BV1mt411w7SV 我破解了自来也暗号的秘密\n第3期:BV1R4411F7YM 我找到了敬汉卿想吃的粉丝\n第2期:BV1ox411f7zD   我算出了四代飞雷神的速度\n第1期:BV1qx411R7TA  我算出了这颗老番茄的尺寸","state":0,"attribute":16768,"duration":222,"mission_id":13106,"rights":{"bp":0,"elec":0,"download":1,"movie":0,"pay":0,"hd5":1,"no_reprint":1,"autoplay":1,"ugc_pay":0,"is_cooperation":0,"ugc_pay_preview":0,"no_background":0},"owner":{"mid":13279707,"name":"最上川下山","face":"http://i0.hdslb.com/bfs/face/46759d94f8937c0adb96c082d8b0ebb67e049692.jpg"},"stat":{"aid":455084926,"view":192728,"danmaku":906,"reply":973,"favorite":3250,"coin":7704,"share":803,"now_rank":0,"his_rank":0,"like":31287,"dislike":0,"evaluation":""},"dynamic":"现在你应该很熟悉百机操演了~~\n百机操演有多少个傀儡,我很好奇","cid":172395082,"dimension":{"width":1920,"height":1080,"rotate":0},"no_cache":false,"pages":[{"cid":172395082,"page":1,"from":"vupload","part":"百机操演多少机?","duration":222,"vid":"","weblink":"","dimension":{"width":1920,"height":1080,"rotate":0}}],"subtitle":{"allow_submit":false,"list":[]}}}

这些就是视频的全部信息,其中aid等于视频av号

那么我们用这个aid来获取一下此视频信息:访问https://api.bilibili.com/x/web-interface/view?aid=455084926

你会发现,返回的信息跟上面一样,就证明接口没有问题

AV转BV转AV?

那么我们已经拿到了哔哩哔哩视频信息接口,也测试过了(没问题)那么就可以用到我们的项目中来,我这里只写思路了(明天得上班),相信各位的代码水平都比我强百倍

人已赞赏
Linux学习笔记技术杂烩

美化宝塔nginx防火墙

2020-3-14 16:28:00

HTML学习笔记

网站全局黑白代码

2020-4-4 0:12:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索