Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat(voompplay): add file import functionality for cookies JSON and update token input label
Tonho468096634b31
diff --git a/src/routes/courses/voompplay/+page.svelte b/src/routes/courses/voompplay/+page.svelteindex 3f5de260..62b3ad11 100644--- a/src/routes/courses/voompplay/+page.svelte+++ b/src/routes/courses/voompplay/+page.svelte@@ -19,6 +19,18 @@let loading = $state(false);let error = $state("");+ let fileInput: HTMLInputElement = $state() as HTMLInputElement;++ function onFileSelected(e: Event) {+ const input = e.target as HTMLInputElement;+ const file = input.files?.[0];+ if (!file) return;+ const reader = new FileReader();+ reader.onload = () => { token = reader.result as string; };+ reader.readAsText(file);+ input.value = "";+ }+let checking = $state(true);let loggedIn = $state(false);let sessionEmail = $state("");@@ -293,16 +305,27 @@<div class="form"><label class="field">- <span class="field-label">Token</span>+ <span class="field-label">Cookies JSON</span><textareaclass="input token-textarea"- placeholder="Paste your token here (no Bearer prefix)..."+ placeholder="Paste cookies JSON from browser extension or a raw token"bind:value={token}disabled={loading}- rows="4"+ rows="5"></textarea></label>+ <input+ type="file"+ accept=".json,.txt"+ class="hidden-file-input"+ bind:this={fileInput}+ onchange={onFileSelected}+ />+ <button class="button" onclick={() => fileInput?.click()} disabled={loading}>+ Import .json file+ </button>+{#if error}<p class="error-msg">{error}</p>{/if}@@ -477,10 +500,15 @@margin-block: 0;}+ .hidden-file-input {+ display: none;+ }+.token-textarea {resize: vertical;min-height: 80px;- font-size: 12px;+ font-size: 11.5px;+ font-family: var(--font-mono);line-height: 1.5;}