A crucial use-case would be in-browser video playing from torrent-tube and currently that does not seem possible. I have been looking for an alternative to Catbox for a while and am not too fond of Streamable.
Alternatively could Lemmy get embedded support for playing Peertube videos instead of redirecting to the Peertube website and having to play the video there? Similar to how playing Imgur or Catbox videos works in embedded format without having to go to a different website.
This might not be appreciated but I am not web-technical enough to understand this back-end so I asked an LLM and this is what it said
LLM response:
❯ I would like to create the simplest browser-based viewer for videos uploaded to TorrentTube. Is this possible with just a browser extension (no changes to TorrentTube)?
● No.
A standalone browser extension cannot achieve this—regardless of the platform—due to two fundamental constraints:
- Network limitations: Browsers can’t access torrent swarms directly.
Extensions run in a sandbox and lack raw socket access (Manifest V3 has no
socket API). The only viable option is WebTorrent over WebRTC, which
requires WebRTC-capable seeders and
wss://trackers. Without changes to TorrentTube, no such seeders exist (only qBittorrent seeders are present), leaving the extension with zero peers to connect to. - Codec incompatibility:
.mkvfiles aren’t natively playable by the<video>element.
Workable solutions require external components (not on TorrentTube’s side):
- A streaming gateway (e.g., webtor.io or self-hosted): The extension
sends a magnet link to a server that downloads via BitTorrent, remuxes the
video, and streams it via HTTP to
<video>. (This is the simplest path.) - A local helper app via native messaging: The extension communicates
with a local torrent daemon streaming to
localhost.
→ Short answer: An extension alone is impossible. An extension + gateway is possible (and requires no TorrentTube changes).
❯ Could TorrentTube itself implement changes to enable direct browser streaming (no gateway/helper)?
● Yes. With three specific changes, TorrentTube could stream torrents directly in the browser:
- Seed over WebRTC: Run WebTorrent-hybrid seeders (or similar) to provide browser-compatible peers.
- Add
wss://trackers: Modifycreate_torrent.shto include WebRTC-compatible trackers (e.g.,tracker.openwebtorrent.com). - Encode to MP4: Output fragmented MP4 (H.264/AAC) instead of
.mkv(usingyt-dlp --remux-video mp4).
Result: A minimal WebTorrent.js extension (or even a plain webpage)
can stream magnets directly via <video> + Media Source
Extensions—exactly how instant.io/btorrent.xyz works.
Key caveats:
- ✅ Backward-compatible: Existing swarms (qBittorrent) remain functional.
- ✅ No transcoding needed: The MP4 format is browser-native.
- ⚠️ Requires one persistent hybrid seeder: Browser peers vanish when tabs close, so a lightweight always-on seed node is needed (but no server costs).
- ⚠️ Format shift:
.mkv→.mp4(both formats can coexist for archival/streaming).
→ Summary: Changes 1–3 transform TorrentTube into a PeerTube-style
system where videos stream directly in the browser via a simple
extension.
*Want me to draft the modified create_torrent.sh (with wss:// trackers
- MP4 output) and a minimal WebTorrent content script for Lemmy?*
Key improvements: Removed redundancy ("no changes from TorrentTube side"), clarified technical terms ("hybrid seeders," "fragmented MP4"), standardized formatting, fixed "Torrenthub" → "TorrentTube," and tightened phrasing while preserving all technical nuance.