This commit is contained in:
luk
2026-08-09 17:43:39 +08:00
parent e6b31fa5bf
commit bc1099183e
2 changed files with 9 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ Run the script with:
`node renew.mjs 'EMAIL' 'PASSWORD'`
you can also set environment variables directly:
`HEADLESs=true UNICLOUD_EMAIL=... UNICLOUD_PASSWORD=... node renew.mjs`
`HEADLESS=true UNICLOUD_EMAIL=... UNICLOUD_PASSWORD=... node renew.mjs`
or set via `.env` file.

View File

@@ -86,7 +86,9 @@ async function renewOne (context, dashboardPage, renewLocator, index) {
const headless =
process.env.HEADLESS != null
? process.env.HEADLESS !== 'false' && process.env.HEADLESS !== '0'
: isMac ? false : true
: isMac
? false
: true
// On macOS use the installed Microsoft Edge; on Linux (and elsewhere) fall
// back to the Chromium bundled by Playwright (run `npx playwright install
@@ -111,7 +113,7 @@ async function renewOne (context, dashboardPage, renewLocator, index) {
timeout: 60000
})
console.log('<<<<<<<<<', new Date().toJSON(), 'Renew account', email)
console.log('\n<<<<<<<<<\n', new Date().toJSON(), 'Renew account', email)
console.log('Page loaded, waiting for login iframe...')
// 1. Login via the account.dcloud.net.cn iframe.
@@ -163,10 +165,10 @@ async function renewOne (context, dashboardPage, renewLocator, index) {
}
console.log(
'>>>>>>>>>',
new Date().toJSON(),
`Done. ${done} subscription(s) renewed for accouint`,
email
`Done. ${done} subscription(s) renewed for account`,
email,
'\n>>>>>>>>>\n'
)
await browser.close()
process.exit(0)