diff options
| author | Fuwn <[email protected]> | 2024-07-23 02:38:43 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-07-23 02:38:43 -0700 |
| commit | de23e157633d344ed261184142121ec977ac5721 (patch) | |
| tree | 8b573a4e3b677905075544eaf251d6344d00e9d7 | |
| parent | feat(Manga): allow preferring native chapter count (diff) | |
| download | due.moe-de23e157633d344ed261184142121ec977ac5721.tar.xz due.moe-de23e157633d344ed261184142121ec977ac5721.zip | |
feat(proxy): enable level two proxy encoding
| -rw-r--r-- | src/lib/Utility/proxy.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/Utility/proxy.ts b/src/lib/Utility/proxy.ts index 8305441d..019f4594 100644 --- a/src/lib/Utility/proxy.ts +++ b/src/lib/Utility/proxy.ts @@ -1,8 +1,16 @@ import { env } from '$env/dynamic/public'; -export const proxy = (url: string, disable = false) => - env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') && !disable +export const proxy = (url: string, disable = true) => { + const randomKey = Math.floor(Math.random() * 90) + 10; + + return env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') && !disable ? url - : `https://proxy.due.moe/?d=${btoa(url)}`; + : `https://proxy.due.moe/?d2=${btoa( + url + .split('') + .map((char) => char.charCodeAt(0) + randomKey) + .join(':') + )}${randomKey}`; +}; export default proxy; |