btv_api
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Bilibili API

整合了一些哔哩哔哩API,方便调用。

如果想在前端使用,请自行解决跨域问题OvO

学习使用,请勿商用。

使用方法

安装模块

npm install btv_api

导入模块

const btv = require('btv_api')

视频搜索

async function a(){
   const a = await btv.search('关键词')
    console.log(a)
}
a()

返回的数据格式如下

[
  {
    picture_url: '视频封面',
    url: '视频链接',
    title: '标题',
    views: '播放量',
    danmuCount: '弹幕数',
    author: '作者',
    date: '发布日期'
  },
  ...
]

原理

使用cheerio获取网站中的数据,转成JSON数据。

Readme

Keywords

Package Sidebar

Install

npm i btv_api

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

4.89 kB

Total Files

5

Last publish

Collaborators

  • al_studio