The OrangeAPI provides a Web-based API framework for developers wishing to develop applications more easily.
This project originates from VexMusic.
The author (IceCold) can't continue to develop new APIs and fix issues because of the upcoming National Matriculation Entrance Test. But you can easily use the Netease
API which is already quite complete.
By using OrangeAPI, you can access the APIs of Netease Music and Bilibili more easily. APIs related to Bilibili are under development.
- Netease Music
- Bilibili (Beta)
JDK 8 or above is required.
4 parts of Netease Music API have been encapsulated by the Orange API framework and can be used directly.
JavaDoc:https://gcecold.github.io/OrangeAPI/javadoc/
NeteaseUserAPI neteaseUserAPI = new NeteaseUserAPI();
//md5 password
//email
neteaseUserAPI.login("xxxxx@126.com","7b7bc2512ee1fedcd76bdc68926d4f7b");
//phone
neteaseUserAPI.loginPhone("13333333333","7b7bc2512ee1fedcd76bdc68926d4f7b");
You can refer to Binaryify/NeteaseCloudMusicApi to develop your own new API.
Here is an example. NeteasePlayListAPI#playlistDetail
public static NeteaseResponseBody playlistDetail(String id,String s,Map<String,String> cookie){
Map<String, String> data = new HashMap<>();
data.put("id", id);
data.put("n", "100000");
data.put("s", s);
NeteaseRequestOptions requestOptions = new NeteaseRequestOptions("https://music.163.com/api/v6/playlist/detail", NeteaseCrypto.CryptoType.LINUXAPI, cookie, Request.UserAgentType.PC);
return NeteaseRequest.postRequest(requestOptions, data);
}
A simple music bot:https://github.com/GceCold/MusicBot
//File format must be "FLV"
new BilibiliVideoAPI().getVideoUrlV1("BV1uv411z7MB").download(new File("1.flv"), 10);
By calling the method BilibiliDownloaderThread#getCompleteRate
, you can get the completion progress of the download.
It's still under development.
Add the following Maven dependency to the pom.xml file of your own project:
<dependency>
<groupId>ltd.icecold</groupId>
<artifactId>OrangeAPI</artifactId>
<version>1.0.1</version>
</dependency>
To use Orange API via Gradle, add the following code to your build.gradle file.
implementation group: 'ltd.icecold', name: 'OrangeAPI', version: '1.0.1'