From c3091f3b4db96d3286fd2e7bd39eead9d92558af Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 30 Nov 2023 15:16:22 +0100 Subject: [PATCH] Add support for awork uploads --- src/userscript.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/userscript.ts b/src/userscript.ts index 96089a5d..d453eddb 100644 --- a/src/userscript.ts +++ b/src/userscript.ts @@ -109247,6 +109247,16 @@ var $$IMU_EXPORT$$; return src.replace(/(\/[0-9]+)-[ms](\.[^/.]+)(?:[?#].*)?$/, "$1-orig$2"); } + if (domain_nosub === "awork.com") { + // awork is a project management tool and uploaded assets are private. The URLs in the below example won't work but are still included for illustration purposes. + // https://name-of-workspace.awork.com/api/v1/files/85ee1659-f903-4163-9361-bedf2b242ef9/download?crop=false&width=1024&height=1024&enlarge=false&v=1701093812740 + // https://name-of-workspace.awork.com/api/v1/files/85ee1659-f903-4163-9361-bedf2b242ef9/download?crop=false&enlarge=false&v=1701093812740 + match = src.match(/\/api\/v1\/files\/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\/download\?/); + if (match) { + return remove_queries(src, ["width", "height"]); + } + } +