From ac2d8ba1c3c7fef1faf1fdf8976aa88c7b84bda6 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 30 Jan 2025 13:19:45 +0200 Subject: [PATCH] Fix Amazon response when cover is not found --- coce.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coce.js b/coce.js index c8e7976..6bd88f3 100644 --- a/coce.js +++ b/coce.js @@ -64,7 +64,10 @@ CoceFetcher.prototype.aws = function awsFetcher(ids) { }; https.get(opts, (res) => { const url = `https://${opts.hostname}${opts.path}`; - if (res.statusCode === 200 || res.statusCode === 403) repo.addurl('aws', id, url); + if (res.statusCode === 200 || res.statusCode === 403) { + // 43 bytes is the size of 1x1px gif returned by Amazon + if (res.headers['content-length'] !== '43') repo.addurl('aws', id, url); + } repo.increment(); i += 1; // timeout for next request