Multi-Hoster-Upload/lib
Administrator 84c48ad7d6 fix(doodstream): login path auto-derives the API key → uploads via reliable API
The user uploads with username/password (login), so 3.3.30's "use API when a
key is configured" did nothing for them — and the web-form upload keeps failing
with empty forms on large files. Fix the LOGIN path itself: after logging in,
pull the account's API key out of the logged-in session and upload via the
official doodapi API (which returns result[0].filecode directly, no empty form).
The user keeps using login and configures nothing.

How the key is derived without knowing doodstream's (cookie-gated, unseen)
settings DOM: brute-force candidate extraction + API validation.
- DoodstreamUploader.deriveApiKey(): fetch the logged-in settings page
  (?op=my_account / /settings), pull every plausible long token from form-field
  values + element contents (ranked: tokens near an "api" mention first), and
  validate each against doodapi.co/api/account/info — only the account's real
  key returns status 200. A wrong guess is therefore harmless (fails validation
  → web fallback). Logs the raw settings HTML when nothing validates, so the
  scrape can be refined from a real capture if doodstream's markup differs.
- upload-manager: doodstream login-path now resolves the key ONCE per batch
  (cached by accountId; '' = tried-none) and routes to the API when found, else
  the existing web-form upload. Keyless accounts: one extra probe-login per
  batch, then unchanged.
- Tests: candidate extraction (value/textarea/api_key shapes, api-context
  ranking), validate-then-pick, null→web-fallback, preset short-circuit. 178/178.

If derivation works the login path now uploads via the API. It does NOT change
doodstream's backend; the server run confirms. Falls back safely if no key.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 22:05:20 +02:00
..
account-auth.js fix(doodstream): upload via the doodapi API when an API key exists 2026-05-28 21:42:19 +02:00
backup-crypto.js feat(backup): import legacy password-encrypted backups 2026-04-17 11:22:33 +02:00
clouddrop-upload.js perf: final sweep — hot-path allocation, cached log target, sort-header skip 2026-04-19 14:02:34 +02:00
coalesced-set.js test(coalesce): extract done-removal coalescer + 11 unit tests 2026-04-28 11:59:32 +02:00
config-store.js feat(log): per-hoster toggle for writing links to fileuploader.log 2026-05-23 15:29:25 +02:00
doodstream-upload.js fix(doodstream): login path auto-derives the API key → uploads via reliable API 2026-05-28 22:05:20 +02:00
folder-monitor.js 🐛 fix: folder monitor re-detect deleted files, atomic sync save 2026-03-21 13:31:54 +01:00
hosters.js fix(doodstream): extend 3.3.29 account-poison protection to the API path 2026-05-28 21:48:13 +02:00
log-policy.js feat(log): per-hoster toggle for writing links to fileuploader.log 2026-05-23 15:29:25 +02:00
log-rotation.js test(log): extract log-rotation into testable module + 10 unit tests 2026-04-28 05:10:53 +02:00
queue-dedup.js fix(queue): stop auto-dedup from deleting pending jobs on restart/update 2026-05-25 01:08:59 +02:00
queue-prune.js test(queue): extract terminal-job prune into testable module + 10 tests 2026-04-28 06:41:47 +02:00
remote-capture-preload.js debug: add IPC logging from capture window to main process 2026-03-12 08:46:18 +01:00
remote-capture.html fix: native resolution capture + correct click offset for title bar 2026-03-12 08:55:46 +01:00
remote-server.js 🐛 fix(remote): clean up auth timeout and client state on WebSocket error 2026-03-21 11:40:18 +01:00
secret-store.js fix: encrypt hoster credentials at rest; history CSV Link column urls-only 2026-04-19 11:53:59 +02:00
semaphore.js test: add unit tests (41) and UI smoke tests (21), fix semaphore listener leak 2026-03-10 10:55:50 +01:00
throttle.js fix: multiple bugs found in deep code analysis 2026-03-11 04:16:50 +01:00
throttled-cache.js test(sort): extract throttled-cache utility + 12 unit tests 2026-04-28 07:12:52 +02:00
updater.js 🐛 fix: response body double-read regression + updater JSON safety 2026-03-21 15:35:18 +01:00
upload-manager.js fix(doodstream): login path auto-derives the API key → uploads via reliable API 2026-05-28 22:05:20 +02:00
vidmoly-upload.js fix(vidmoly): correct multipart fields & JSON response shape 2026-04-19 22:43:17 +02:00
voe-upload.js chore: remove unused imports (powerSaveBlocker, statusCode) 2026-03-22 14:49:43 +01:00