From f8d89eb8e6f048de2530a279373f22eb410ec05f Mon Sep 17 00:00:00 2001 From: Fornax Date: Mon, 28 Feb 2022 16:57:54 +0100 Subject: [PATCH] Explain rate limits on download page --- .../file_viewer/viewers/FilePreview.svelte | 6 +- .../src/file_viewer/viewers/RateLimit.svelte | 72 +++++++++++++++---- 2 files changed, 62 insertions(+), 16 deletions(-) diff --git a/svelte/src/file_viewer/viewers/FilePreview.svelte b/svelte/src/file_viewer/viewers/FilePreview.svelte index 9adf746..16b10d8 100644 --- a/svelte/src/file_viewer/viewers/FilePreview.svelte +++ b/svelte/src/file_viewer/viewers/FilePreview.svelte @@ -21,7 +21,11 @@ export const set_file = async file => { return } else if (file.abuse_type !== "") { viewer_type = "abuse" - } else if (file.availability === "file_rate_limited_captcha_required") { + } else if ( + file.availability !== "file_rate_limited_captcha_required" || + file.availability !== "ip_download_limited_captcha_required" || + file.availability !== "ip_transfer_limited_captcha_required" + ) { viewer_type = "rate_limit" } else { viewer_type = file_type(file) diff --git a/svelte/src/file_viewer/viewers/RateLimit.svelte b/svelte/src/file_viewer/viewers/RateLimit.svelte index 40c7c9f..98addd3 100644 --- a/svelte/src/file_viewer/viewers/RateLimit.svelte +++ b/svelte/src/file_viewer/viewers/RateLimit.svelte @@ -1,5 +1,6 @@ -

- file_download_off - Hotlink protection enabled -

- -

- Hotlinking protection has been enabled for this file. This happens when - a file is downloaded many times outside of our file viewer page (this - page). Usually this means people are using download managers like - JDownloader 2, Aria2 or wget. Using a download manager circumvents - pixeldrain's advertisements and we lose money because of that. More - information about this protection mechanism can be found on the home page. -

+ {#if file.availability === "file_rate_limited_captcha_required"} +

+ file_download_off + Hotlink protection enabled +

+

+ Hotlinking protection has been enabled for this file. This happens when + a file is downloaded many times outside of our file viewer page (this + page). Usually this means people are using download managers like + JDownloader 2, Aria2 or wget. Using a download manager circumvents + pixeldrain's advertisements and we lose money because of that. More + information about this protection mechanism can be found on the home page. +

+ {:else if + file.availability === "ip_download_limited_captcha_required" || + file.availability === "ip_transfer_limited_captcha_required" + } +

+ file_download_off + Download limit reached +

+

+ You have reached your download limit for today. People without a + pixeldrain account are limited to downloading + {limits.download_limit} files or + {formatDataVolume(limits.transfer_limit, 3)} per day. This limit is + counted per IP address, so if you're on a shared network it's + possible that others have also contributed to this limit. +

+

+ In the last 24 hours you have downloaded + {limits.download_limit_used} files and used + {formatDataVolume(limits.transfer_limit_used, 3)} bandwidth. +

+ {/if}

This warning disappears when the you are a Patreon supporter,