I saw my previous answer used Synapse for HTTPClient.
Here... I rewrote the example using fphttpclient.
Change the username and password and it should login correctly.
After the login, it retrieves a profile page. If it contains the text "Cannot access profile settings as a guest user." there was a problem.
Otherwise the login was succesfull.
You can use the same instance of Client (which now contains the correct session-cookies) to scrape the private thread.
I tested it with a dummy spam account I made there, so it does work.
{$mode delphi}{$ifdef windows}{$apptype console}{$endif}{$H+}
uses
Sysutils,
classes,
fphttpclient,
opensslsockets;
var
ForumUrl, FormData, Username, Password: string;
Client: TFPHttpClient;
Response : string;
Cookies: string;
begin
ForumUrl := 'https://forums.winamp.com'; // <-- CHANGE THIS
Username := 'username'; // <-- CHANGE THIS
Password := 'password'; // <-- CHANGE THIS
FormData := 'username=' + Username + '&password=' + Password + '&privacyconsent=1&securitytoken=guest';
Client := TFPHttpClient.Create(nil);
try
writeln(client.httpversion);
Client.AddHeader('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)');
Client.AllowRedirect := true;
try
Response := Client.FormPost(ForumUrl + '/auth/ajax-login', FormData);
// writeln(Response);
Cookies := Client.Cookies.Text; // you can save this for later. It will expire after a while though.
writeln('Login success ' + Client.ResponseStatusCode.ToString + ' ' + Client.ResponseStatusText);
Response := Client.Get(ForumUrl + '/settings/profile');
if Pos('Cannot access profile', Response) > 0 then
writeln('Get PROBLEM "Cannot access profile" ' + Client.ResponseStatusCode.ToString + ' ' + Client.ResponseStatusText)
else
begin
writeln('Get success ' + Client.ResponseStatusCode.ToString + ' ' + Client.ResponseStatusText);
writeln(Response);
end;
//
// here you can write your loop to retrieve the private thread
//
except
on E:Exception do
begin
writeln(e.message);
end;
end;
finally
Client.Free;
readln;
end;
end.