1 Star 1 Fork 0

栉风 / flutter-netease-music-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Netease cloud music api for flutter ,reference https://github.com/Binaryify/NeteaseCloudMusicApi.

欢迎star、pr、issues

使用方法

如果你想知道更多如何使用这个库,可以参考我的另外一个项目 ~。https://github.com/hcanyz/flutter-zmusic

添加依赖

dependencies:
  netease_music_api:
    git:
      url: git://github.com/hcanyz/flutter-netease-music-api.git
      #url: git://gitee.com/hcanyz/flutter-netease-music-api.git

使用

final success = await NeteaseMusicApi.init(debug: true);
var api = NeteaseMusicApi();
api.useSomeApi

// 登录态变化
var subscription = api.usc.listenLoginState((event, accountInfoWrap) {
    switch (event) {
    case LoginState.Logined:
      //do some
      print(accountInfoWrap);
      break;
    case LoginState.Logout:
      //do some
      break;
    }
});


// dispose
subscription.cancel();

注意事项

  • unit test 需要在test/目录下添加 private_config.dart
    const String login_email = '';
    const String login_email_password = '';
    
    const String login_phone = '';
    const String login_phone_password = '';
  • 本项目仅供学习使用,请尊重版权,请勿利用此项目从事商业行为或进行破坏版权行为

TODO

  • 搬运 NeteaseCloudMusicApi库 所有api
  • 用户登录数据存储及变化通知
  • api bean 数据结构
  • api unit test
  • 代码结构优化、模块重新划分
  • 文档
  • 持续同步api...

~

  • json String to Bean flutter pub run build_runner build

errorCode

code desc
-460 Cheating
-2 无权限访问
200 ok
201 已经取消关注
250 风险提示
301 需要登录
400 请求(参数异常、无效请求、业务相关)
403 请求参数异常(无效)
404 请求的接口不存在
501 账号不存在
503 验证码错误
405 发送验证码间隔过短
505 更新昵称被占用
509 密码错误超过限制
512 未付费歌曲无法收藏

250: 可能是cookie中缺少 'os':'pc'

flutter version

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 2.1.0-13.0.pre.294, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] VS Code, 64-bit edition (version 1.54.3)
[√] Connected device (1 available)
MIT License Copyright (c) 2020 hcanyz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Netease cloud music api for flutter ,reference https://github.com/Binaryify/NeteaseCloudMusicApi. 展开 收起
Dart
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/hcanyz/flutter-netease-music-api.git
git@gitee.com:hcanyz/flutter-netease-music-api.git
hcanyz
flutter-netease-music-api
flutter-netease-music-api
master

搜索帮助