==============================================================
 A-NET SIXEL-TV 9000 — YouTube BBS Door (Linux x86_64)
==============================================================

A BBS door for Synchronet, Mystic, or anything that writes a
DOOR32.SYS drop file.  Users dial in with SyncTERM (or any
other sixel-capable terminal), search YouTube or paste a URL,
and watch the video render inside an ANSI CRT-TV frame on
their screen.

Audio is served out-of-band via a tiny HTTP server built into
the door — the door shows the user a short URL that they open
on their phone or a second browser tab, and MP3 audio streams
there in sync with the sixel video.

--------------------------------------------------------------
 FILES IN THIS ARCHIVE
--------------------------------------------------------------
  sixeldoor            Static 64-bit Linux binary (~5 MB)
  run.sh               Wrapper your BBS calls (edit this)
  install-bbs-deps.sh  Installs ffmpeg + yt-dlp on the server
  README.txt           This file
  FILE_ID.DIZ          Short description for BBS file listings

--------------------------------------------------------------
 REQUIREMENTS ON THE BBS SERVER
--------------------------------------------------------------
  * Linux x86_64 (tested on Ubuntu 22.04 / 24.04, Debian 12)
  * ffmpeg WITH libmp3lame  (the audio server transcodes MP3)
  * yt-dlp from PyPI  (the distro-packaged version rots fast
                        and will 403 against YouTube constantly)

Install both in one shot:

    sudo ./install-bbs-deps.sh

The script auto-detects apt/dnf/yum, removes any stale
apt/rpm yt-dlp, and installs a current yt-dlp via pip.

--------------------------------------------------------------
 INSTALL
--------------------------------------------------------------

1.  Unzip into your BBS external programs dir, e.g.:

      sudo mkdir -p /sbbs/xtrn/ytube
      sudo unzip sixeldr-linux.zip -d /sbbs/xtrn/ytube/
      cd /sbbs/xtrn/ytube
      sudo chmod +x sixeldoor run.sh install-bbs-deps.sh

2.  Install dependencies:

      sudo ./install-bbs-deps.sh

3.  Edit run.sh and set SIXELDOOR_HOSTNAME to your BBS's
    public hostname or IP:

      SIXELDOOR_HOSTNAME="bbs.yoursite.com"

    Users open the audio URL on their phone, so it must
    resolve from OUTSIDE your LAN.

4.  Open the audio port in your firewall:

      sudo ufw allow 18080/tcp         # if you use ufw
      # or
      sudo iptables -A INPUT -p tcp --dport 18080 -j ACCEPT

5.  Register the door in Synchronet scfg:

      External Programs -> Online Programs (Doors) -> (Add)

      Name:                    YouTube (Sixel)
      Internal Code:           SIXELYT
      Command Line:            /sbbs/xtrn/ytube/run.sh %f
      BBS Drop File Type:      DOOR32.SYS
      Place Drop File in:      Node Directory
      Native (32-bit) Exec:    Yes
      Intercept I/O:           STANDARD (no echo)
      Multiple Concurrent:     Yes

6.  Reconnect from SyncTERM.  Tail the log if something
    misbehaves:

      tail -f /tmp/sixeldoor.log

--------------------------------------------------------------
 MYSTIC BBS
--------------------------------------------------------------

Mystic already understands DOOR32.SYS.  In your door config:

    [door]
    name = YouTube (Sixel)
    cmd  = /mystic/doors/sixelyt/run.sh %Pdoor32.sys
    (D3)

--------------------------------------------------------------
 NOTES & LIMITATIONS
--------------------------------------------------------------

* Only sixel-capable terminals render the video.  SyncTERM
  works.  NetRunner / MagiTerm / IGTerm draw the UI but show
  sixel escape-sequence garbage where the video should be —
  the door's capability probe catches this on real BBS
  connections and shows a "your terminal doesn't support
  sixel" screen, then disconnects.

* Concurrent users:  each door process tries to bind TCP port
  18080 for its audio server.  The first user gets 18080;
  subsequent users get OS-assigned high ports.  Open a port
  range in your firewall if you expect concurrent sessions,
  or accept that audio may be single-user.

* Logs go to /tmp/sixeldoor.log.  If opening the log file
  fails for any reason, logging is silenced — nothing ever
  leaks to the user's screen.

* YouTube aggressively changes its extraction protocol; if
  your users start seeing "HTTP 403 Forbidden" errors, run
  `sudo pip install --upgrade yt-dlp --break-system-packages`
  on the server.  This is true of any yt-dlp-based tool.

--------------------------------------------------------------
 LICENSE
--------------------------------------------------------------

MIT.  Use, modify, redistribute — just don't blame anyone if
your BBS catches fire.
