Exemple #1
0
        /// <summary>
        /// 获取歌词
        /// </summary>
        /// <param name="id">歌曲ID</param>
        /// <returns></returns>
        public static JObject Lyric(string id)
        {
            string data           = $"{{ \"method\":\"POST\",\"url\":\"https://music.163.com/api/song/lyric?lv=-1&kv=-1&tv=-1\",\"params\":{{ \"id\":\"{id}\"}} }}";
            string encodedContent = NeteaseCloudCrypt.LinuxApi(data);

            return(JObject.Parse(Request((HttpWebRequest)WebRequest.Create("https://music.163.com/api/linux/forward"), encodedContent)));
        }
Exemple #2
0
        /// <summary>
        /// 搜索音乐
        /// </summary>
        /// <param name="keyWord">关键词</param>
        /// <returns></returns>
        public static JObject Search(string keyWord)
        {
            string data           = $"{{\"s\":\"{keyWord}\",\"type\":1,\"limit\":30,\"offset\":0,\"csrf_token\":\"\"}}";
            string encodedContent = NeteaseCloudCrypt.WeApi(data);

            return(JObject.Parse(Request((HttpWebRequest)WebRequest.Create("https://music.163.com/weapi/search/get"), encodedContent)));
        }