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
|
[Pp]assword.txt
|
||||||
CVV.txt
|
CVV.txt
|
||||||
CardDetails.txt
|
CardDetails.txt
|
||||||
|
run.bat
|
||||||
|
|
||||||
# ---> VisualStudioCode
|
# ---> VisualStudioCode
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public static class GoogleMessages
|
|||||||
string messageText = await messageElement.InnerTextAsync();
|
string messageText = await messageElement.InnerTextAsync();
|
||||||
|
|
||||||
await originalPage.BringToFrontAsync();
|
await originalPage.BringToFrontAsync();
|
||||||
|
await msgPage.CloseAsync();
|
||||||
return messageText;
|
return messageText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+9
-1
@@ -54,6 +54,7 @@ try
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Error during login: {ex.Message}\nAssuming already logged in, proceeding with booking...");
|
Console.WriteLine($"Error during login: {ex.Message}\nAssuming already logged in, proceeding with booking...");
|
||||||
|
await page.CloseAsync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ catch (PlaywrightException)
|
|||||||
{
|
{
|
||||||
Console.WriteLine($"{DateTime.Now:HH:mm:ss}: Could not find the specified end time slot: {endTime}");
|
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.ScreenshotAsync(new PageScreenshotOptions { Path = "ErrorScreenshot.png" });
|
||||||
|
await page.CloseAsync();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,10 +120,16 @@ var bmlOtp = await GoogleMessages.GetBMLOTP(context, page);
|
|||||||
if (bmlOtp is not null)
|
if (bmlOtp is not null)
|
||||||
Console.WriteLine($"Extracted BML OTP: {bmlOtp}");
|
Console.WriteLine($"Extracted BML OTP: {bmlOtp}");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
await page.CloseAsync();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await page.Locator("input[name='otpValue']").FillAsync(bmlOtp);
|
await page.Locator("input[name='otpValue']").FillAsync(bmlOtp);
|
||||||
await page.GetByRole(AriaRole.Button, new() { Name = "CONFIRM" }).ClickAsync();
|
await page.GetByRole(AriaRole.Button, new() { Name = "CONFIRM" }).ClickAsync();
|
||||||
await Task.Delay(15000);
|
await Task.Delay(15000);
|
||||||
|
|
||||||
var hdcMessage = await GoogleMessages.GetMessageFromHDC(context, page);
|
var hdcMessage = await GoogleMessages.GetMessageFromHDC(context, page);
|
||||||
Console.WriteLine($"Message from HDC: {hdcMessage}");
|
Console.WriteLine($"Message from HDC: {hdcMessage}");
|
||||||
|
|
||||||
|
await page.CloseAsync();
|
||||||
@@ -8,4 +8,6 @@ In the future perhaps it would be much better if I can deploy as a webapp that c
|
|||||||
**`dotnet run -- 22:00`**
|
**`dotnet run -- 22:00`**
|
||||||
Where `22:00` is the end time of the prefered time. `22:00` is the slot from `21:00 - 22:00`.
|
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.
|
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