diff --git a/lib/hosters.js b/lib/hosters.js index 78baa10..5dbdafe 100644 --- a/lib/hosters.js +++ b/lib/hosters.js @@ -448,7 +448,10 @@ async function _resolveByseUploadByName(apiKey, fileName, baselineCodes, signal) async function _fetchDoodstreamFileList(apiKey, signal) { // doodapi.co file list: { msg, status:200, result: { files: [{ file_code, title, uploaded, ... }] } } - const url = `https://doodapi.co/api/file/list?key=${encodeURIComponent(apiKey)}&per_page=200`; + // sort=created&order=desc forces newest-first — VERIFIED against a real 90k-file + // account, where a single page without it could miss a just-uploaded file. The + // recovery only needs the most recent uploads, so page 1 newest-first suffices. + const url = `https://doodapi.co/api/file/list?key=${encodeURIComponent(apiKey)}&per_page=200&sort=created&order=desc`; try { const { body, statusCode } = await request(url, { method: 'GET', signal,