Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

xwartz/doubanfm-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doubanfm-sdk

js-standard-style Build Status codecov npm

豆瓣 FM SDK

使用

import WebSDK from 'doubanfm-sdk'

const wsdk = new WebSDK()

const operate = (method, opt, cb) => {
  wsdk[method](opt, (err, data) => {
    if (err) return console.error(err) // error handle
    cb && cb(data)
  })
}

API

获取验证码 id

operate('captchaId', null, id => {
  // todo
})

登录

const opt = {
  alias: '',
  form_password: '',
  captcha_solution: '',
  captcha_id: '',
  source: 'radio',
  task: 'sync_channel_list'
}
operate('login', opt, data => {
  // todo
})

登出

operate('logout', () => {
  // todo
})

获取频道

operate('channels', opt, data => {
  // todo
})

获取热门频道

operate('hotChannels', opt, data => {
  // todo
})

加心

operate('star', opt, data => {
  // todo
})

取消红心

operate('unstar', opt, data => {
  // todo
})

不再播放

operate('neverPlayAgain', opt, data => {
  // todo
})

获取歌词

operate('lyric', opt, data => {
  // todo
})

获取用户信息

operate('userInfo', opt, data => {
  // todo
})

License

MIT