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> |
||
|---|---|---|
| .. | ||
| mock_peertube.py | ||
| README.md | ||
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
git checkout tools/screenshot-mock- Start the proxy on the host:
python3 tools/mock/mock_peertube.py(port 8080; needs only Python 3 stdlib). - Build + install the debug build on the emulator:
./gradlew :app:assembleDebug && adb install -r app/build/outputs/apk/debug/app-debug.apk - 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. - Drive the UI with
adb shell input …andadb shell screencapto capturehome,drawer,myvideos,channels,player, and a channel page. - Commit the PNGs on
main(only the images), not here.