Skip to content

Commit

Permalink
0.9.9.20
Browse files Browse the repository at this point in the history
- Fixed login
  • Loading branch information
ImAiiR committed Aug 10, 2020
1 parent ba8b9e3 commit bcc81b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions QobuzDownloaderX/LoginForm-v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,16 +447,27 @@ private async void loginBG_DoWork(object sender, DoWorkEventArgs e)
{
loginBG.WorkerSupportsCancellation = true;

// Create HttpClient to grab Track ID
// Create HttpClient for logging in using Napster / Rhapsody API.
var loginClient = new HttpClient();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; //Make connection secure
loginClient.DefaultRequestHeaders.Add("Authorization", "Basic WlRKbE9XTmhaR1V0TnpsbVpTMDBaR1UyTFRrd1lqTXRaRGsxT0RSbE1Ea3dPRE01Ok1UUmpaVFZqTTJFdE9HVmxaaTAwT1RVM0xXRm1Oamt0TlRsbE9ERmhObVl5TnpJNQ=="); //This value is from logging in to the Napster Android app.



// Create HttpClient to grab Track ID
var loginClient2 = new HttpClient();
// Run through TLS to allow secure connection.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
// Set user-agent to Firefox.
loginClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0");

var loginURL = "https://www.qobuz.com/api.json/0.2/user/login"; //Set base URL
var parameters = new Dictionary<string, string> { { "username", emailTextbox.Text }, { "email", emailTextbox.Text }, { "password", passwordTextbox.Text }, { "extra", "partner" }, { "app_id", appID } }; //Set email & password parameters
var encodedContent = new FormUrlEncodedContent(parameters); //Add parameters as encoded content to login

// Grab response from Rhapsody to get Track IDs from Album response.
var loginUrl = "https://www.qobuz.com/api.json/0.2/user/login?email=" + emailTextbox.Text + "&password=" + passwordTextbox.Text + "&app_id=" + appID;
var loginResponse = await loginClient.GetAsync(loginUrl);
var loginResponse = await loginClient.PostAsync(loginURL, encodedContent);
string loginResponseString = loginResponse.Content.ReadAsStringAsync().Result;

// Grab metadata from API JSON response
Expand Down
4 changes: 2 additions & 2 deletions QobuzDownloaderX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.9.19")]
[assembly: AssemblyFileVersion("0.9.9.19")]
[assembly: AssemblyVersion("0.9.9.20")]
[assembly: AssemblyFileVersion("0.9.9.20")]

0 comments on commit bcc81b8

Please sign in to comment.