Beispiel #1
0
        /// <summary>
        /// Creates a playlist with given name
        /// </summary>
        /// <param name="playlistName">Name of playlist</param>
        public void AddPlaylist(String playlistName)
        {
            String jsonString = "{\"title\":\"" + playlistName + "\"}";

            Dictionary<String, String> fields = new Dictionary<String, String>
            {
               {"json", jsonString}
            };

            FormBuilder form = new FormBuilder();
            form.AddFields(fields);
            form.Close();

            ConnectionClient.UploadDataAsync(new Uri("https://play.google.com/music/services/addplaylist"), form, PlaylistCreated);
        }
Beispiel #2
0
 public HttpWebRequest UploadDataAsync(Uri address, FormBuilder form, RequestCompletedEventHandler complete)
 {
     return UploadDataAsync(address, form.ContentType, form.GetBytes(), complete);
 }
Beispiel #3
0
        //{"deleteId":"c790204e-1ee2-4160-9e25-7801d67d0a16"}
        public void DeletePlaylist(String id)
        {
            String jsonString = "{\"id\":\"" + id + "\"}";

            Dictionary<String, String> fields = new Dictionary<String, String>
            {
               {"json", jsonString}
            };

            FormBuilder form = new FormBuilder();
            form.AddFields(fields);
            form.Close();

            ConnectionClient.UploadDataAsync(new Uri("https://play.google.com/music/services/deleteplaylist"), form, PlaylistDeleted);
        }
Beispiel #4
0
        public void Login(String email, String password)
        {
            Dictionary<String, String> fields = new Dictionary<String, String>
            {
                {"service", "sj"},
                {"Email",  email},
                {"Passwd", password},
            };

            FormBuilder form = new FormBuilder();
            form.AddFields(fields);
            form.Close();

            ConnectionClient.UploadDataAsync(new Uri("https://www.google.com/accounts/ClientLogin"), form.ContentType, form.GetBytes(),  GetAuthTokenComplete);
        }
Beispiel #5
0
        /// <summary>
        /// Returns specified user/instant playlist
        /// </summary>
        public void GetPlaylist(String plID)
        {
            String jsonString = (plID.Equals("all")) ? "{}" : "{\"id\":\"" + plID + "\"}";

            Dictionary<String, String> fields = new Dictionary<String, String>() { };

            fields.Add("json", jsonString);

            FormBuilder builder = new FormBuilder();
            builder.AddFields(fields);
            builder.Close();

            if (plID.Equals("all"))
                ConnectionClient.UploadDataAsync(new Uri("https://play.google.com/music/services/loadplaylist"), builder, PlaylistRecv);
            else
                ConnectionClient.UploadDataAsync(new Uri("https://play.google.com/music/services/loadplaylist"), builder, PlaylistRecvSingle);
        }
Beispiel #6
0
        /// <summary>
        /// Gets all the songs
        /// </summary>
        /// <param name="continuationToken"></param>
        public void GetAllSongs(String continuationToken = "")
        {
            List<Models.GoogleMusicSong> library = new List<Models.GoogleMusicSong>();

            String jsonString = "{\"continuationToken\":\"" + continuationToken + "\"}";

            Dictionary<String, String> fields = new Dictionary<String, String>
            {
               {"json", jsonString}
            };

            FormBuilder form = new FormBuilder();
            form.AddFields(fields);
            form.Close();

            ConnectionClient.UploadDataAsync(new Uri("https://play.google.com/music/services/loadalltracks"), form, TrackListChunkRecv);
        }