1.0.2 • Published 7 years ago

music-apis v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Wow, such a powerful music API framework

Install

npm install music-apis

use

const musicApi = require('music-apis')

const api = new musicApi()


/**
 * 获取音乐信息
 *
 *	id 音乐id
 **/
api.song(id)
.then(res => res[0])
.then(res => {
	console.log(res)
})

/**
 * 歌手
 *
 * id 歌手id
 * limit 返回行数
 **/
api.artist(id, limit).then(res=>{
	console.log(res)
})


/**
 * 专辑
 *
 * id 专辑id
 **/
api.album(id).then(res => {
	console.log(res)
})


/**
 * 歌单
 *
 * id 歌单id
 **/
api.playlist(res => {
	console.log(res)
})


/**
 * 搜索
 *
 * keyword 关键字
 * options.limit 返回行数
 * options.page 当前页数
 **/
api.search(keywords, {
	limit: 10,
	page: 1
}).then(res => {
	console.log(res)
})

/**
 * 音频链接
 *
 * id 音乐id
 * br 音频质量
 **/
api.url(id, br).then(res => {
	console.log(res)
})

/**
 * 图片链接
 *
 * id 图片id
 * size 图片尺寸
 **/
api.pic(id, size).then(res=>{
	console.log(res)
})


/**
 * 歌词
 *
 * id 歌词id
 **/
api.lyric(id).then(res => {
	console.log(res)
})

Author

music-apis © Medu.tv, Released under the MIT License.

Blog Medu.tv - Github WuYunlong - Email17771258@qq.com

1.0.2

7 years ago

1.0.1

7 years ago