Recently Written · git

subread-extension

Show your own .srt over a YouTube video, in time with it. Chrome and Firefox.

git clone https://github.com/equwal/subread-extension

Log | Files | Refs


commit 6d6a99eb59ddb0f658216c246c076ff56fb1a29e
equwal <truex@equwal.com>
2026-09-21 03:50:00 -0700

Add a screenshot to the README

 README.md                   |   4 ++++
 docs/screenshots/player.png | Bin 0 -> 30529 bytes
 tests/mock/server.py        |  11 ++++++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index eca4f81..82f2cb7 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,10 @@ in the browser), then read along on the video.
 
 Press **SR** at the top right of the player, and choose the `.srt`.
 
+![The caption over the player, and the SR panel: file, start, speed, size](docs/screenshots/player.png)
+
+The picture is from the stand-in page in `tests/mock/` (`/watch?v=mock&demo`), not from YouTube.
+
 - **Start**: the video on YouTube often has an intro that your audio file does
   not. Play to where the narrator reads the first line and press
   **First line is now**, or move the start by 0.1 s and 1 s.
diff --git a/docs/screenshots/player.png b/docs/screenshots/player.png
new file mode 100644
index 0000000..37ef70e
Binary files /dev/null and b/docs/screenshots/player.png differ
diff --git a/tests/mock/server.py b/tests/mock/server.py
index e3d9f03..8c4b06e 100644
--- a/tests/mock/server.py
+++ b/tests/mock/server.py
@@ -21,7 +21,16 @@ PAGE = b"""<!doctype html><meta charset=utf-8><title>mock watch page</title>
   setInterval(() => { g.fillStyle = '#123'; g.fillRect(0, 0, 320, 180); g.fillStyle = '#fff'; g.fillText(String(n++), 10, 20); }, 100);
   const v = document.querySelector('video'); v.srcObject = c.captureStream(10); v.play();
 </script>
-<script src=/src/srt.js></script><script src=/src/content.js></script>"""
+<script src=/src/srt.js></script><script src=/src/content.js></script>
+<script>
+  // ?demo : subtitles loaded and the panel open, for a screenshot.
+  if (location.search.includes('demo')) setTimeout(() => {
+    const srt = '1\\n00:00:00,000 --> 09:00:00,000\\n\\u543e\\u8f29\\u306f\\u732b\\u3067\\u3042\\u308b\\u3002\\u540d\\u524d\\u306f\\u307e\\u3060\\u7121\\u3044\\u3002\\n';
+    const input = document.querySelector('.subread-file'), dt = new DataTransfer();
+    dt.items.add(new File([srt], 'wagahai.ja.srt')); input.files = dt.files; input.dispatchEvent(new Event('change'));
+    document.querySelector('.subread-button').click();
+  }, 800);
+</script>"""
 
 class Handler(http.server.SimpleHTTPRequestHandler):
     def __init__(self, *a, **k): super().__init__(*a, directory=str(ROOT), **k)