This commit is contained in:
dahyeon committed 2026-08-13 01:34:54 +09:00
1 parent d2c03d155d
commit db60190e19
13 files changed
+505 -38

No files matched your search

+6 -8
View File
@@ -1,4 +1,4 @@
import { ipcMain, shell } from 'electron'
import { ipcMain } from 'electron'
import type {
Branch,
PriceOption,
@@ -10,6 +10,7 @@ import type {
TimeSlot,
} from '../../src/type/reservation'
import { edgeBrowserHeaders, encodeMultipart, requestKeyescape } from './keyescape-http'
import { openCaptchaWindow } from './captcha-window'
const BASE_URL = 'https://www.keyescape.com'
const API_URL = `${BASE_URL}/controller/run_proc.php`
@@ -235,13 +236,8 @@ async function prepare(rawSelection: Record<string, unknown>): Promise<PriceOpti
return options
}
async function openCaptcha(rawSelection: Record<string, unknown>): Promise<void> {
const branchNum = asPositiveInteger(rawSelection.branchNum, '지점')
const themeNum = asPositiveInteger(rawSelection.themeNum, '테마')
const themeInfoNum = asPositiveInteger(rawSelection.themeInfoNum, '테마 정보')
await shell.openExternal(
`${BASE_URL}/reservation1.php?zizum_num=${branchNum}&theme_num=${themeNum}&theme_info_num=${themeInfoNum}`,
)
async function openCaptcha(rawSelection: Record<string, unknown>) {
return openCaptchaWindow(normalizeSelection(rawSelection))
}
let reservationSubmissionInFlight = false
@@ -321,6 +317,8 @@ async function executeReservationOnce(rawRequest: ReservationRequest): Promise<R
httpStatus: response.statusCode,
remoteIp: response.remoteIp,
reusedSocket: response.reusedSocket,
protocol: response.protocol,
connectionId: response.connectionId,
observedServerDateMs: Number.isFinite(observedServerDateMs) ? observedServerDateMs : undefined,
}
if (!result.status || !result.data) return { success: false, message, transport }