fix: prevent repeated Doodstream OTP requests
CI / verify (push) Canceled after 0s

Coalesce concurrent and repeated Doodstream login checks by credential identity, keep the challenged cookie session for OTP verification, and rate-limit explicit code resends. Prefer an existing Doodstream API key during health checks and add regression coverage for imports with duplicate accounts, concurrent checks, expired challenges, and session reuse.
This commit is contained in:
Sucukdeluxe
2026-08-31 18:45:37 +02:00
parent 317ff3f035
commit 40ce83d413
10 changed files with 300 additions and 38 deletions
+4 -3
View File
@@ -122,9 +122,10 @@ class DoodstreamUploader {
* Login to DoodStream via web form
*/
async login(username, password, otp) {
// GET homepage first to collect cookies
const homeRes = await this._fetch(BASE_URL);
await homeRes.text();
if (!otp || this.cookies.size === 0) {
const homeRes = await this._fetch(BASE_URL);
await homeRes.text();
}
// POST login via AJAX (op in body, XHR header required for JSON response)
const loginData = new URLSearchParams({