qwenproxy-cli 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clean-cache.js +13 -7
- package/dist/delete-chats.js +13 -7
- package/dist/index.js +14 -8
- package/dist/login.js +13 -7
- package/dist/reset-cooldowns.js +13 -7
- package/package.json +1 -1
- package/src/core/version.ts +1 -1
- package/src/services/playwright.ts +19 -8
package/dist/clean-cache.js
CHANGED
|
@@ -4035,10 +4035,16 @@ async function loginViaUi(page, email, password) {
|
|
|
4035
4035
|
);
|
|
4036
4036
|
return { success: false, reason: "Campo de e-mail n\xE3o encontrado (poss\xEDvel captcha)" };
|
|
4037
4037
|
}
|
|
4038
|
+
await clearVisibleChallenge(page);
|
|
4039
|
+
const findPasswordModeButton = () => {
|
|
4040
|
+
return page.locator('button, [role="button"], a, div').filter({
|
|
4041
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i
|
|
4042
|
+
}).first();
|
|
4043
|
+
};
|
|
4038
4044
|
try {
|
|
4039
|
-
const pwdModeBtn =
|
|
4040
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4041
|
-
await pwdModeBtn.click().catch(() => {
|
|
4045
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4046
|
+
if (await pwdModeBtn.isVisible({ timeout: 2e3 }).catch(() => false)) {
|
|
4047
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4042
4048
|
});
|
|
4043
4049
|
await sleep2(500);
|
|
4044
4050
|
}
|
|
@@ -4047,9 +4053,9 @@ async function loginViaUi(page, email, password) {
|
|
|
4047
4053
|
await page.fill(emailSelector, email);
|
|
4048
4054
|
await sleep2(300);
|
|
4049
4055
|
try {
|
|
4050
|
-
const pwdModeBtn =
|
|
4051
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4052
|
-
await pwdModeBtn.click().catch(() => {
|
|
4056
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4057
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
4058
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4053
4059
|
});
|
|
4054
4060
|
await sleep2(500);
|
|
4055
4061
|
}
|
|
@@ -4074,7 +4080,7 @@ async function loginViaUi(page, email, password) {
|
|
|
4074
4080
|
}
|
|
4075
4081
|
await page.fill(passwordSelector, password);
|
|
4076
4082
|
await sleep2(500);
|
|
4077
|
-
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
4083
|
+
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesi\xF3n"), button:has-text("\u767B\u5F55")';
|
|
4078
4084
|
const submitButton = page.locator(submitSelector).first();
|
|
4079
4085
|
try {
|
|
4080
4086
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|
package/dist/delete-chats.js
CHANGED
|
@@ -4910,10 +4910,16 @@ async function loginViaUi(page, email, password) {
|
|
|
4910
4910
|
);
|
|
4911
4911
|
return { success: false, reason: "Campo de e-mail n\xE3o encontrado (poss\xEDvel captcha)" };
|
|
4912
4912
|
}
|
|
4913
|
+
await clearVisibleChallenge(page);
|
|
4914
|
+
const findPasswordModeButton = () => {
|
|
4915
|
+
return page.locator('button, [role="button"], a, div').filter({
|
|
4916
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i
|
|
4917
|
+
}).first();
|
|
4918
|
+
};
|
|
4913
4919
|
try {
|
|
4914
|
-
const pwdModeBtn =
|
|
4915
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4916
|
-
await pwdModeBtn.click().catch(() => {
|
|
4920
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4921
|
+
if (await pwdModeBtn.isVisible({ timeout: 2e3 }).catch(() => false)) {
|
|
4922
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4917
4923
|
});
|
|
4918
4924
|
await sleep2(500);
|
|
4919
4925
|
}
|
|
@@ -4922,9 +4928,9 @@ async function loginViaUi(page, email, password) {
|
|
|
4922
4928
|
await page.fill(emailSelector, email);
|
|
4923
4929
|
await sleep2(300);
|
|
4924
4930
|
try {
|
|
4925
|
-
const pwdModeBtn =
|
|
4926
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4927
|
-
await pwdModeBtn.click().catch(() => {
|
|
4931
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4932
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
4933
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4928
4934
|
});
|
|
4929
4935
|
await sleep2(500);
|
|
4930
4936
|
}
|
|
@@ -4949,7 +4955,7 @@ async function loginViaUi(page, email, password) {
|
|
|
4949
4955
|
}
|
|
4950
4956
|
await page.fill(passwordSelector, password);
|
|
4951
4957
|
await sleep2(500);
|
|
4952
|
-
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
4958
|
+
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesi\xF3n"), button:has-text("\u767B\u5F55")';
|
|
4953
4959
|
const submitButton = page.locator(submitSelector).first();
|
|
4954
4960
|
try {
|
|
4955
4961
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|
package/dist/index.js
CHANGED
|
@@ -6127,10 +6127,16 @@ async function loginViaUi(page, email, password) {
|
|
|
6127
6127
|
);
|
|
6128
6128
|
return { success: false, reason: "Campo de e-mail n\xE3o encontrado (poss\xEDvel captcha)" };
|
|
6129
6129
|
}
|
|
6130
|
+
await clearVisibleChallenge(page);
|
|
6131
|
+
const findPasswordModeButton = () => {
|
|
6132
|
+
return page.locator('button, [role="button"], a, div').filter({
|
|
6133
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i
|
|
6134
|
+
}).first();
|
|
6135
|
+
};
|
|
6130
6136
|
try {
|
|
6131
|
-
const pwdModeBtn =
|
|
6132
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
6133
|
-
await pwdModeBtn.click().catch(() => {
|
|
6137
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
6138
|
+
if (await pwdModeBtn.isVisible({ timeout: 2e3 }).catch(() => false)) {
|
|
6139
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
6134
6140
|
});
|
|
6135
6141
|
await sleep2(500);
|
|
6136
6142
|
}
|
|
@@ -6139,9 +6145,9 @@ async function loginViaUi(page, email, password) {
|
|
|
6139
6145
|
await page.fill(emailSelector, email);
|
|
6140
6146
|
await sleep2(300);
|
|
6141
6147
|
try {
|
|
6142
|
-
const pwdModeBtn =
|
|
6143
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
6144
|
-
await pwdModeBtn.click().catch(() => {
|
|
6148
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
6149
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
6150
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
6145
6151
|
});
|
|
6146
6152
|
await sleep2(500);
|
|
6147
6153
|
}
|
|
@@ -6166,7 +6172,7 @@ async function loginViaUi(page, email, password) {
|
|
|
6166
6172
|
}
|
|
6167
6173
|
await page.fill(passwordSelector, password);
|
|
6168
6174
|
await sleep2(500);
|
|
6169
|
-
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
6175
|
+
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesi\xF3n"), button:has-text("\u767B\u5F55")';
|
|
6170
6176
|
const submitButton = page.locator(submitSelector).first();
|
|
6171
6177
|
try {
|
|
6172
6178
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|
|
@@ -25492,7 +25498,7 @@ function getAppVersion() {
|
|
|
25492
25498
|
}
|
|
25493
25499
|
} catch {
|
|
25494
25500
|
}
|
|
25495
|
-
cachedVersion = "v1.4.
|
|
25501
|
+
cachedVersion = "v1.4.2";
|
|
25496
25502
|
return cachedVersion;
|
|
25497
25503
|
}
|
|
25498
25504
|
var cachedVersion;
|
package/dist/login.js
CHANGED
|
@@ -4995,10 +4995,16 @@ async function loginViaUi(page, email, password) {
|
|
|
4995
4995
|
);
|
|
4996
4996
|
return { success: false, reason: "Campo de e-mail n\xE3o encontrado (poss\xEDvel captcha)" };
|
|
4997
4997
|
}
|
|
4998
|
+
await clearVisibleChallenge(page);
|
|
4999
|
+
const findPasswordModeButton = () => {
|
|
5000
|
+
return page.locator('button, [role="button"], a, div').filter({
|
|
5001
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i
|
|
5002
|
+
}).first();
|
|
5003
|
+
};
|
|
4998
5004
|
try {
|
|
4999
|
-
const pwdModeBtn =
|
|
5000
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
5001
|
-
await pwdModeBtn.click().catch(() => {
|
|
5005
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
5006
|
+
if (await pwdModeBtn.isVisible({ timeout: 2e3 }).catch(() => false)) {
|
|
5007
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
5002
5008
|
});
|
|
5003
5009
|
await sleep2(500);
|
|
5004
5010
|
}
|
|
@@ -5007,9 +5013,9 @@ async function loginViaUi(page, email, password) {
|
|
|
5007
5013
|
await page.fill(emailSelector, email);
|
|
5008
5014
|
await sleep2(300);
|
|
5009
5015
|
try {
|
|
5010
|
-
const pwdModeBtn =
|
|
5011
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
5012
|
-
await pwdModeBtn.click().catch(() => {
|
|
5016
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
5017
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
5018
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
5013
5019
|
});
|
|
5014
5020
|
await sleep2(500);
|
|
5015
5021
|
}
|
|
@@ -5034,7 +5040,7 @@ async function loginViaUi(page, email, password) {
|
|
|
5034
5040
|
}
|
|
5035
5041
|
await page.fill(passwordSelector, password);
|
|
5036
5042
|
await sleep2(500);
|
|
5037
|
-
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
5043
|
+
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesi\xF3n"), button:has-text("\u767B\u5F55")';
|
|
5038
5044
|
const submitButton = page.locator(submitSelector).first();
|
|
5039
5045
|
try {
|
|
5040
5046
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|
package/dist/reset-cooldowns.js
CHANGED
|
@@ -4271,10 +4271,16 @@ async function loginViaUi(page, email, password) {
|
|
|
4271
4271
|
);
|
|
4272
4272
|
return { success: false, reason: "Campo de e-mail n\xE3o encontrado (poss\xEDvel captcha)" };
|
|
4273
4273
|
}
|
|
4274
|
+
await clearVisibleChallenge(page);
|
|
4275
|
+
const findPasswordModeButton = () => {
|
|
4276
|
+
return page.locator('button, [role="button"], a, div').filter({
|
|
4277
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i
|
|
4278
|
+
}).first();
|
|
4279
|
+
};
|
|
4274
4280
|
try {
|
|
4275
|
-
const pwdModeBtn =
|
|
4276
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4277
|
-
await pwdModeBtn.click().catch(() => {
|
|
4281
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4282
|
+
if (await pwdModeBtn.isVisible({ timeout: 2e3 }).catch(() => false)) {
|
|
4283
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4278
4284
|
});
|
|
4279
4285
|
await sleep2(500);
|
|
4280
4286
|
}
|
|
@@ -4283,9 +4289,9 @@ async function loginViaUi(page, email, password) {
|
|
|
4283
4289
|
await page.fill(emailSelector, email);
|
|
4284
4290
|
await sleep2(300);
|
|
4285
4291
|
try {
|
|
4286
|
-
const pwdModeBtn =
|
|
4287
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
4288
|
-
await pwdModeBtn.click().catch(() => {
|
|
4292
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
4293
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
4294
|
+
await pwdModeBtn.click({ timeout: 2e3 }).catch(() => {
|
|
4289
4295
|
});
|
|
4290
4296
|
await sleep2(500);
|
|
4291
4297
|
}
|
|
@@ -4310,7 +4316,7 @@ async function loginViaUi(page, email, password) {
|
|
|
4310
4316
|
}
|
|
4311
4317
|
await page.fill(passwordSelector, password);
|
|
4312
4318
|
await sleep2(500);
|
|
4313
|
-
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
4319
|
+
const submitSelector = 'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesi\xF3n"), button:has-text("\u767B\u5F55")';
|
|
4314
4320
|
const submitButton = page.locator(submitSelector).first();
|
|
4315
4321
|
try {
|
|
4316
4322
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qwenproxy-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "High-performance OpenAI & Anthropic compatible API gateway for Qwen with multi-account rotation, interactive TUI, and resilient tool calling.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"bin": {
|
package/src/core/version.ts
CHANGED
|
@@ -2375,11 +2375,22 @@ async function loginViaUi(
|
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
2377
|
// In Qwen Web, if the page opens on the default email OTP panel, click "Log in with a password"
|
|
2378
|
-
// to reveal the standard email + password form.
|
|
2378
|
+
// (supporting English, Portuguese, Spanish, Chinese) to reveal the standard email + password form.
|
|
2379
|
+
await clearVisibleChallenge(page);
|
|
2380
|
+
|
|
2381
|
+
const findPasswordModeButton = () => {
|
|
2382
|
+
return page
|
|
2383
|
+
.locator('button, [role="button"], a, div')
|
|
2384
|
+
.filter({
|
|
2385
|
+
hasText: /(?:log\s*in\s*with\s*(?:a\s*)?password|fazer\s*login\s*com\s*senha|entrar\s*com\s*(?:uma\s*)?senha|iniciar\s*sesi[oó]n\s*con\s*contrase[nñ]a|密码登录)/i,
|
|
2386
|
+
})
|
|
2387
|
+
.first();
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2379
2390
|
try {
|
|
2380
|
-
const pwdModeBtn =
|
|
2381
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
2382
|
-
await pwdModeBtn.click().catch(() => {});
|
|
2391
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
2392
|
+
if (await pwdModeBtn.isVisible({ timeout: 2000 }).catch(() => false)) {
|
|
2393
|
+
await pwdModeBtn.click({ timeout: 2000 }).catch(() => {});
|
|
2383
2394
|
await sleep(500);
|
|
2384
2395
|
}
|
|
2385
2396
|
} catch {}
|
|
@@ -2390,9 +2401,9 @@ async function loginViaUi(
|
|
|
2390
2401
|
|
|
2391
2402
|
// If "Log in with a password" button appeared after typing email, click it
|
|
2392
2403
|
try {
|
|
2393
|
-
const pwdModeBtn =
|
|
2394
|
-
if (await pwdModeBtn.isVisible({ timeout:
|
|
2395
|
-
await pwdModeBtn.click().catch(() => {});
|
|
2404
|
+
const pwdModeBtn = findPasswordModeButton();
|
|
2405
|
+
if (await pwdModeBtn.isVisible({ timeout: 1500 }).catch(() => false)) {
|
|
2406
|
+
await pwdModeBtn.click({ timeout: 2000 }).catch(() => {});
|
|
2396
2407
|
await sleep(500);
|
|
2397
2408
|
}
|
|
2398
2409
|
} catch {}
|
|
@@ -2426,7 +2437,7 @@ async function loginViaUi(
|
|
|
2426
2437
|
// Prefer clicking the submit button; fall back to pressing Enter.
|
|
2427
2438
|
// The button starts disabled and only enables once both fields are filled.
|
|
2428
2439
|
const submitSelector =
|
|
2429
|
-
'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in")';
|
|
2440
|
+
'button.qwenchat-auth-pc-submit-button, button[type="submit"], button:has-text("Log in"), button:has-text("Sign in"), button:has-text("Fazer login"), button:has-text("Entrar"), button:has-text("Iniciar sesión"), button:has-text("登录")';
|
|
2430
2441
|
const submitButton = page.locator(submitSelector).first();
|
|
2431
2442
|
try {
|
|
2432
2443
|
await page.waitForSelector('button[type="submit"]:not([disabled])', {
|