Skip to content

🍰NET平台 强大的音乐接口🎵支持网易云音乐、QQ音乐 | 🍰Powerful music API under .NET🎵Support NetEase music, Tencent Music

License

Notifications You must be signed in to change notification settings

ELDment/CSharp-Music-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author Star

🍰 .NET平台强大的音乐API框架,支持网易云音乐、QQ音乐

✨ Wow, such a powerful .NET music API framework, Support Netease Music, Tencent(QQ) Music.

Introduction

一个强大的音乐平台API框架,他会助力您的开发❤️

  • 🍰优雅 - 使用简单, 为全平台构造了统一数据结构
  • 🙀强大 - 支持主流音乐平台, 包含:网易云音乐、QQ音乐
  • 🤩免费 - 使用GPLv3协议

Requirement

Newtonsoft.Json

📍Note: 测试开发时使用NetCore8.0

Building

克隆项目库

git clone https://github.com/ELDment/CSharp-Music-API.git

通过以下指令构建库:

cd CSharp-Music-API

dotnet clean

dotnet build -c Release

或者直接运行测试模块:

cd CSharp-Music-API

dotnet test

📍Note: 编译时库要求 Newtonsoft.Json

Quick Start

//using MusicAPI;

public class Program {
	static async Task Main(string[] args) {
		//声明平台API实例
		var api = new NeteaseAPI();
		//var api = new TencentAPI();

		//设置Headers
		api.Headers = new Dictionary<string, string> { { "Addition", "12345" } /*, { "Cookie", "Yours" }*/ };

		//搜索歌曲
		var search = await api.Search("Avid", limit: 5);
		var song = search[0]!;
		Console.WriteLine(song);

		//获取歌曲信息
		var songInfo = await api.GetSong(song!.Id);
		Console.WriteLine(songInfo);

		//获取歌曲资源
		var songResource = await api.GetSongResource(song!.Id);
		Console.WriteLine(songResource);

		//获取歌词
		var songLyric = await api.GetLyric(song!.Id);
		Console.WriteLine(songLyric);

		//获取歌曲头图
		var songPicture = await api.GetPicture(song!.Id, 520);
		Console.WriteLine(songPicture);

		return;
	}
}

More usage

Related Projects

Contribution

  • samyycX 项目发起者之一 😋 重构并制定了代码标准
  • (欢迎大家提交高质量PR🤓👍)

About

🍰NET平台 强大的音乐接口🎵支持网易云音乐、QQ音乐 | 🍰Powerful music API under .NET🎵Support NetEase music, Tencent Music

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages