Esempio n. 1
0
        private static String[] GetComments(int music_id)
        {
            NeteaseMusicAPI.NeteaseMusicAPI NMAPI = new NeteaseMusicAPI.NeteaseMusicAPI();
            int     offset   = 0;
            JObject Response = NMAPI.GetSongComments(id: music_id, offset: offset);

            String[] C = new string[(int)Response["total"]];
            JToken   Comments;

            while (true)
            {
                Comments = Response["comments"];
                for (int i = offset; i < offset + Comments.Count(); i++)
                {
                    C[i] = (String)Comments[i - offset]["content"];
                }
                if (!(Boolean)Response["more"])
                {
                    break;
                }
                offset  += 20;
                Response = NMAPI.GetSongComments(id: music_id, offset: offset);
            }
            return(C);
        }
Esempio n. 2
0
        private static String[] GetLyrics(int music_id)
        {
            NeteaseMusicAPI.NeteaseMusicAPI NMAPI = new NeteaseMusicAPI.NeteaseMusicAPI();
            JObject Music = NMAPI.GetLyric(id: music_id);
            String  Lyric = (String)Music["lrc"]["lyric"];

            String[] Sentences = Lyric.Split('\n');
            return(Sentences);
        }