Compare commits
10 Commits
228e6b896e
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| daba023cf6 | |||
| c988075ce7 | |||
| 62f8f1b44b | |||
| 46e793135f | |||
| 3cb7ba3092 | |||
| 5f509fc996 | |||
| 3933128ed8 | |||
| 9b1ed22ad1 | |||
| cacc40ef3b | |||
| e5024d1582 |
@@ -1,6 +1,7 @@
|
||||
[Pp]assword.txt
|
||||
CVV.txt
|
||||
CardDetails.txt
|
||||
run.bat
|
||||
|
||||
# ---> VisualStudioCode
|
||||
.vscode/*
|
||||
|
||||
@@ -58,6 +58,7 @@ public static class GoogleMessages
|
||||
string messageText = await messageElement.InnerTextAsync();
|
||||
|
||||
await originalPage.BringToFrontAsync();
|
||||
await msgPage.CloseAsync();
|
||||
return messageText;
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@ try
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error during login: {ex.Message}\nAssuming already logged in, proceeding with booking...");
|
||||
await page.CloseAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,6 +99,7 @@ catch (PlaywrightException)
|
||||
{
|
||||
Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Could not find the specified end time slot: {endTime}");
|
||||
await page.ScreenshotAsync(new PageScreenshotOptions { Path = "ErrorScreenshot.png" });
|
||||
await page.CloseAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,10 +120,16 @@ var bmlOtp = await GoogleMessages.GetBMLOTP(context, page);
|
||||
if (bmlOtp is not null)
|
||||
Console.WriteLine($"Extracted BML OTP: {bmlOtp}");
|
||||
else
|
||||
{
|
||||
await page.CloseAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
await page.Locator("input[name='otpValue']").FillAsync(bmlOtp);
|
||||
await page.GetByRole(AriaRole.Button, new() { Name = "CONFIRM" }).ClickAsync();
|
||||
await Task.Delay(15000);
|
||||
|
||||
var hdcMessage = await GoogleMessages.GetMessageFromHDC(context, page);
|
||||
Console.WriteLine($"Message from HDC: {hdcMessage}");
|
||||
|
||||
await page.CloseAsync();
|
||||
@@ -9,3 +9,5 @@ In the future perhaps it would be much better if I can deploy as a webapp that c
|
||||
Where `22:00` is the end time of the prefered time. `22:00` is the slot from `21:00 - 22:00`.
|
||||
|
||||
Preferably the application will be run close to 8AM around 7:45AM so that there's need to perpetually keep refreshing the site for a long time.
|
||||
|
||||
**``OWO``**
|
||||
Reference in New Issue
Block a user