jtube-tv/tools/mock
Jeena 671d2dd661 tools: relabel upstream host in the mock so the Channels screen populates
The app decides a video/channel is "local" by matching its host against the
instance host; relabel peertube2.cpy.re to the proxy's own host in the JSON
(host fields only, never URLs) and map handles back when proxying, so the
Channels screen and channel pages work through the mock.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-15 13:06:44 +00:00
..
mock_peertube.py tools: relabel upstream host in the mock so the Channels screen populates 2026-10-15 13:06:44 +00:00
README.md tools: screenshot mock backend (branch-only) 2026-10-15 12:58:09 +00:00

Screenshot mock backend

Throwaway tooling to regenerate the README screenshots without exposing the private family content on the real instance. Lives on the tools/screenshot-mock branch only — main never carries the mock or the cleartext flag.

mock_peertube.py is a thin HTTP proxy to the public PeerTube demo instance (peertube2.cpy.re, real CC/Blender content) with a handful of overrides so the authenticated screens are populated without an account (login always succeeds, a "Demo User" with an avatar, Continue watching / My videos / Subscriptions each show a different slice so thumbnails don't repeat, My videos gets privacy badges, and a channel page shows the full video grid). Media and images still load straight from peertube2 over HTTPS; only the JSON and thumbnails pass through the proxy. The app itself runs unmodified — the only app-side change is the debug-only android:usesCleartextTraffic="true" in app/src/debug/ that lets a debug build reach the proxy over HTTP.

Regenerate the screenshots

  1. git checkout tools/screenshot-mock
  2. Start the proxy on the host: python3 tools/mock/mock_peertube.py (port 8080; needs only Python 3 stdlib).
  3. Build + install the debug build on the emulator: ./gradlew :app:assembleDebug && adb install -r app/build/outputs/apk/debug/app-debug.apk
  4. On the setup screen enter http://10.0.2.2:8080 (the emulator's alias for the host) and sign in with any username/password.
  5. Drive the UI with adb shell input … and adb shell screencap to capture home, drawer, myvideos, channels, player, and a channel page.
  6. Commit the PNGs on main (only the images), not here.