aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-30 18:03:52 +0000
committerAdam Soltys <[email protected]>2026-09-30 18:03:52 +0000
commitc5030c0b56463974fdac5b963c5a1c217b30ba5c (patch)
treee952c4e4e8e0719a8ab118a2499da0a02f423858 /src
parent0570f48910ddc4ea10d27fb8ab7992fbd013a0b7 (diff)
downloadcoinosv3-c5030c0b56463974fdac5b963c5a1c217b30ba5c.tar.gz
coinosv3-c5030c0b56463974fdac5b963c5a1c217b30ba5c.zip
Public pictures and videos go to blossom.ditto.pub first, then primal, nostr.download, nostr.build.
A 2026-09-30 benchmark (4 MB mp4, 110 KB jpeg; upload then fetch, twice): ditto took the mp4 in ~0.6 s and serves from ~120 ms; primal ~1.5 s; nostr.download ~1-2 s but rejects a JPEG with data after its end marker (motion photos); blossom.nostr.build ~5 s with ~600 ms first byte. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WMMwWYJkPQxLgfMsY7hWcU
Diffstat (limited to 'src')
-rw-r--r--src/media-upload.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/media-upload.js b/src/media-upload.js
index 9301939..c06771b 100644
--- a/src/media-upload.js
+++ b/src/media-upload.js
@@ -2,11 +2,13 @@ import { sha256 } from '@noble/hashes/sha256';
import { bytesToHex } from '@noble/hashes/utils';
// Independent public hosts: a phone upload should not fail just because one
-// provider is down or rejects a particular container. nostr.build is the
-// widely-used Blossom home and goes first; nostr.download (which advertises
-// large image/video/audio uploads) is the fallback — it was unreachable for
-// hours on 2026-09-30, and every upload waited on it.
-export const PUBLIC_MEDIA_SERVERS = ['https://blossom.nostr.build', 'https://nostr.download'];
+// provider is down or rejects a particular container. Order from a
+// 2026-09-30 benchmark (4 MB mp4 / 110 KB jpeg, uploaded then fetched):
+// ditto took the mp4 in ~0.6 s and serves in ~120 ms; primal ~1.5 s; nostr.
+// download ~1-2 s but refuses a JPEG with bytes after its end marker (motion
+// photos); blossom.nostr.build ~5 s. The first to accept the file wins.
+export const PUBLIC_MEDIA_SERVERS = ['https://blossom.ditto.pub', 'https://blossom.primal.net',
+ 'https://nostr.download', 'https://blossom.nostr.build'];
export class MediaUploadError extends Error {
constructor(code, details = '') {