feat: We have improved the search and download logic for NetEase Cloud Music playlists and added support for logging in.

This commit is contained in:
real-zony
2023-03-12 23:19:27 +08:00
parent afe1a7013c
commit b916323986
8 changed files with 146 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ public static class NetEaseMusicEncryptionHelper
public const string Nonce = "0CoJUm6Qyw8W8jud";
public const string PubKey = "010001";
public const string Vi = "0102030405060708";
public static readonly byte[] ID_XOR_KEY_1 = "3go8&$8*3*3h0k(2)2"u8.ToArray();
public static string RsaEncode(string text)
{
@@ -90,4 +91,19 @@ public static class NetEaseMusicEncryptionHelper
return sb.ToString();
}
public static string CloudMusicDllEncode(string deviceId)
{
var xored = new byte[deviceId.Length];
for (var i = 0; i < deviceId.Length; i++)
{
xored[i] = (byte)(deviceId[i] ^ ID_XOR_KEY_1[i % ID_XOR_KEY_1.Length]);
}
using (var md5 = MD5.Create())
{
var digest = md5.ComputeHash(xored);
return Convert.ToBase64String(digest);
}
}
}