dsh-hackertube 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +146 -173
- package/README.md +147 -175
- package/client.js +3635 -2568
- package/index.js +4126 -3215
- package/mirror.js +768 -0
- package/package.json +7 -2
- package/recommend.js +431 -0
package/README.en.md
CHANGED
|
@@ -1,250 +1,223 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# HackerTube for DeepSeek Harness
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Two Decades of Hacker News Top Technical Videos — Right Inside Your IDE**
|
|
6
6
|
|
|
7
|
-
](https://www.npmjs.com/package/dsh-hackertube)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](https://github.com/chow651/dsh-hackertube)
|
|
11
|
+
[](package.json)
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
[English](README.en.md) | [简体中文](README.md)
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
<br />
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
<p align="center">
|
|
18
|
+
No need to switch back and forth between editor tabs and a browser.<br />
|
|
19
|
+
Browse and watch 6,454 high-impact engineering talks, lectures, and documentaries<br />
|
|
20
|
+
recommended over twenty years on Hacker News, directly in your <b>DeepSeek Harness</b> workspace.<br />
|
|
21
|
+
Featuring full bilingual support, subtitle-aware AI answers, and a native Agent search tool.
|
|
22
|
+
</p>
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+

|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
</div>
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
---
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
## ✨ Key Features
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| Hardware & Electronics | 8 | 582 |
|
|
30
|
-
| Computing History & Culture | 8 | 1026 |
|
|
31
|
-
| Design, Graphics & Visual Media | 9 | 439 |
|
|
32
|
-
| Business, Startups & Economics | 9 | 644 |
|
|
33
|
-
| Politics, History & Society | 9 | 1018 |
|
|
34
|
-
| Physics, Space & Chemistry | 8 | 600 |
|
|
35
|
-
| Life Sciences, Mind & Health | 11 | 598 |
|
|
36
|
-
| Earth, Energy & Environment | 8 | 354 |
|
|
37
|
-
| Engineering, Transport & Making | 12 | 805 |
|
|
38
|
-
| Games & Game Development | 8 | 355 |
|
|
39
|
-
| Arts, Comedy, Music & Film | 12 | 1344 |
|
|
40
|
-
| Ideas, Learning & Language | 9 | 689 |
|
|
32
|
+
- 📺 **Seamless In-Editor Player**: Dedicated local relay avoids third-party embed and referrer restrictions. Watch high-value engineering talks side-by-side with your code without tab-switching.
|
|
33
|
+
- 🤖 **Subtitle-Aware AI Q&A**: Asking "what is this part about?" extracts the exact subtitle window around your current playhead (±3 mins) for grounded, precise technical explanations.
|
|
34
|
+
- 🇨🇳 **Built-in Bilingual Localization**: Ships with 6,454 Chinese titles and 166 taxonomy categories ready on install. Summaries and discussions support both on-demand model translation and machine translation fallback.
|
|
35
|
+
- 🔍 **Native Agent Tool**: Registers `hackertube_search` so your AI agent can query 20 years of HN technical recommendations directly inside coding conversations.
|
|
36
|
+
- 🎯 **Smart Alternative Mirrors**: Automatically identifies quality mirrors and subtitled versions on Chinese platforms (Bilibili) using strict physical duration fingerprints. Shows a direct entry only when found; remains completely silent otherwise.
|
|
37
|
+
- ⚡ **Zero Runtime Dependencies & Vector Recommendations**: Pure native Node.js implementation with 384-dimensional vector centroid recommendations. Fast cold starts and host-side persistence.
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
---
|
|
43
40
|
|
|
44
|
-
##
|
|
41
|
+
## 🚀 Quick Start
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
> **Prerequisite**: A running installation of [DeepSeek Harness](https://github.com/chow651/dsh-hackertube).
|
|
47
44
|
|
|
48
|
-
### Let
|
|
45
|
+
### Option 1: Let Your Agent Install It (Recommended)
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
Simply send this prompt to your agent inside DeepSeek Harness:
|
|
51
48
|
|
|
52
|
-
```
|
|
49
|
+
```text
|
|
53
50
|
Install and enable the HackerTube plugin: plugin_manager install_bundle target=dsh-hackertube.
|
|
54
51
|
If npm fails, use target=github:chow651/dsh-hackertube instead.
|
|
55
52
|
Then confirm dsh-hackertube is enabled in the plugin list and remind me to refresh the page.
|
|
56
53
|
```
|
|
57
54
|
|
|
58
|
-
### Install
|
|
55
|
+
### Option 2: Install via Plugin Manager
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
Run directly in the DSH terminal:
|
|
61
58
|
|
|
62
|
-
```
|
|
59
|
+
```bash
|
|
63
60
|
plugin_manager install_bundle target=dsh-hackertube
|
|
61
|
+
# Or directly from the GitHub repository:
|
|
62
|
+
# plugin_manager install_bundle target=github:chow651/dsh-hackertube
|
|
64
63
|
```
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
plugin_manager install_bundle target=github:chow651/dsh-hackertube
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Install with npm or pnpm
|
|
65
|
+
### Option 3: Manual Package Install
|
|
73
66
|
|
|
74
|
-
```
|
|
67
|
+
```bash
|
|
68
|
+
# Inside your DSH profile directory
|
|
75
69
|
npm install dsh-hackertube
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
70
|
+
# or
|
|
79
71
|
pnpm add dsh-hackertube
|
|
80
72
|
```
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
Enable `dsh-hackertube` in your plugin list and refresh the workspace. **No API keys or manual database initialization required.**
|
|
83
75
|
|
|
84
|
-
|
|
76
|
+
---
|
|
85
77
|
|
|
86
|
-
##
|
|
78
|
+
## 🤖 Native Agent Tool Integration
|
|
87
79
|
|
|
88
|
-
|
|
80
|
+
The plugin registers `hackertube_search` with DeepSeek Harness. Your agent can search the library semantically during development workflows:
|
|
89
81
|
|
|
90
|
-
|
|
82
|
+
### Example Exchange
|
|
91
83
|
|
|
92
|
-
|
|
84
|
+
> **You**: Is there any video explaining the Raft consensus algorithm? Ideally by the author.
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
**Agent** calls `hackertube_search({ query: "Raft consensus", limit: 5 })` and replies:
|
|
95
87
|
|
|
96
|
-
|
|
88
|
+
> Yes, Raft's author Diego Ongaro delivered a comprehensive lecture at Stanford: *Raft User Study Lecture* (58 min, recommended by 4 HN members). HN comments highlight that it is much more approachable than reading the paper alone. You can also watch the accompanying *Paxos Lecture* (67 min) for foundational background.
|
|
89
|
+
> 🔗 https://www.youtube.com/watch?v=YbZ3zDzDnrw
|
|
97
90
|
|
|
98
|
-
###
|
|
91
|
+
### Tool Parameters
|
|
99
92
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `l` | Like |
|
|
106
|
-
| `w` | Add to watch later |
|
|
107
|
-
| `h` | Back to home |
|
|
108
|
-
| `?` | Show all shortcuts |
|
|
109
|
-
| `Esc` | Close overlay |
|
|
93
|
+
| Parameter | Type | Required | Description |
|
|
94
|
+
|---|---|---|---|
|
|
95
|
+
| `query` | string | Yes | Search query in English or Chinese (e.g. `compiler optimization`, `micrograd`) |
|
|
96
|
+
| `limit` | number | No | Number of results to return (default `5`, max `15`) |
|
|
97
|
+
| `lang` | string | No | Language for returned text: `zh` (default) or `en` |
|
|
110
98
|
|
|
111
|
-
|
|
99
|
+
---
|
|
112
100
|
|
|
113
|
-
|
|
101
|
+
## 💡 Comparison with the Original Site
|
|
114
102
|
|
|
115
|
-
|
|
103
|
+
Built upon Andrej Karpathy's open [HackerTube data export](https://karpathy.bearblog.dev/hacker-tube/), tailored specifically for developer environments:
|
|
116
104
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
2. Backpropagation, intuitively | Deep Learning Chapter 3 — 3Blue1Brown · 13 min · 6.4M views · 4 recommenders
|
|
129
|
-
HN: Recommended as the most accessible introduction to backprop for people who struggle with the pure math.
|
|
130
|
-
https://www.youtube.com/watch?v=Ilg3gGewQ5U
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
The agent answers:
|
|
105
|
+
| Capability | Original Site | HackerTube DSH Plugin |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| **Context** | Standalone web browser | **Embedded inside DSH workspace** |
|
|
108
|
+
| **Localization** | English only | **Full EN/ZH bilingual**, 6,454 translated titles ready |
|
|
109
|
+
| **AI Q&A** | None | **Subtitle-aware temporal Q&A** |
|
|
110
|
+
| **Agent Tool** | None | **Native `hackertube_search` tool** |
|
|
111
|
+
| **Mirror Sources** | YouTube only | **Smart physical fingerprint matching for mirrors** |
|
|
112
|
+
| **State Persistence** | Ephemeral browser storage | **Host-side local persistence** (safe across cache clears) |
|
|
113
|
+
| **Recommendations** | None | **384-d vector centroid + HN co-recommendation graph** |
|
|
114
|
+
| **Offline Resilience** | Full network dependent | **Local caching + graceful offline degradation** |
|
|
134
115
|
|
|
135
|
-
|
|
136
|
-
> https://www.youtube.com/watch?v=VMj-3S1tku0
|
|
116
|
+
---
|
|
137
117
|
|
|
138
|
-
|
|
118
|
+
## 🖥️ Watch Page & Shortcuts
|
|
139
119
|
|
|
140
|
-
|
|
141
|
-
- A few lectures on compiler optimization
|
|
142
|
-
- Which Karpathy video covers backpropagation
|
|
120
|
+

|
|
143
121
|
|
|
144
|
-
###
|
|
122
|
+
### Keyboard Shortcuts
|
|
145
123
|
|
|
146
|
-
|
|
124
|
+
| Key | Action | Key | Action |
|
|
125
|
+
|---|---|---|---|
|
|
126
|
+
| `/` | Focus search bar | `j` / `k` | Navigate cards up/down |
|
|
127
|
+
| `Enter` | Open selected video | `l` | Like / Unlike |
|
|
128
|
+
| `w` | Add to Watch Later | `h` | Return to Home |
|
|
129
|
+
| `?` | Show shortcut cheatsheet | `Esc` | Close details or overlay |
|
|
147
130
|
|
|
148
|
-
|
|
149
|
-
|---|---|
|
|
150
|
-
| `query` | Search terms, English or Chinese |
|
|
151
|
-
| `limit` | Result count, default 5, max 15 |
|
|
152
|
-
| `lang` | Language for the returned text, `zh` or `en`, default `zh` |
|
|
131
|
+
### 🎯 Smart Alternative Mirrors
|
|
153
132
|
|
|
154
|
-
|
|
133
|
+
For users facing network restrictions or seeking localized subtitles, the watch view dynamically checks for verified Chinese platform (Bilibili) mirrors:
|
|
155
134
|
|
|
156
|
-
|
|
135
|
+
- **Strict Fingerprint Verification**: Compares exact duration (within ±2s tolerance), chronological release order, and bidirectional description references to rule out homonymous uploads or derivative commentary.
|
|
136
|
+
- **Tier Quality Ranking**: Prioritizes `Official Channel` → `Subtitled / Translated` → `High-definition Repost`.
|
|
137
|
+
- **Zero Noise & Silent Lookup**: Lookups are on-demand and cached locally. If no valid mirror exists, **no placeholder is rendered** — keeping the interface clean and distraction-free.
|
|
157
138
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
| First install, empty cache | about 10 seconds |
|
|
161
|
-
| Later launches, list load | 45 ms |
|
|
162
|
-
| Opening a watch page | 10 ms |
|
|
163
|
-
| Related, the 3,778 videos with co-recommendation data | 2 ms |
|
|
164
|
-
| Related, the other 2,676 videos, by vector similarity | about 0.7 s on first use |
|
|
165
|
-
| Machine translation of summary and recommendation note | 0.4 to 1.8 s on first use |
|
|
139
|
+
<details>
|
|
140
|
+
<summary><b>📂 Click to expand: 16 Core Knowledge Domains (6,454 Videos)</b></summary>
|
|
166
141
|
|
|
167
|
-
|
|
142
|
+
<br />
|
|
168
143
|
|
|
169
|
-
|
|
144
|
+

|
|
170
145
|
|
|
171
|
-
|
|
146
|
+
| Area | Subcategories | Videos |
|
|
147
|
+
|---|---:|---:|
|
|
148
|
+
| Software Engineering & Languages | 11 | 980 |
|
|
149
|
+
| Systems, Networks & Security | 10 | 702 |
|
|
150
|
+
| AI, Machine Learning & Data | 9 | 576 |
|
|
151
|
+
| Mathematics & Theoretical CS | 9 | 360 |
|
|
152
|
+
| Hardware & Electronics | 8 | 582 |
|
|
153
|
+
| Computing History & Culture | 8 | 1026 |
|
|
154
|
+
| Design, Graphics & Visual Media | 9 | 439 |
|
|
155
|
+
| Business, Startups & Economics | 9 | 644 |
|
|
156
|
+
| Politics, History & Society | 9 | 1018 |
|
|
157
|
+
| Physics, Space & Chemistry | 8 | 600 |
|
|
158
|
+
| Life Sciences, Mind & Health | 11 | 598 |
|
|
159
|
+
| Earth, Energy & Environment | 8 | 354 |
|
|
160
|
+
| Engineering, Transport & Making | 12 | 805 |
|
|
161
|
+
| Games & Game Development | 8 | 355 |
|
|
162
|
+
| Arts, Comedy, Music & Film | 12 | 1344 |
|
|
163
|
+
| Ideas, Learning & Language | 9 | 689 |
|
|
172
164
|
|
|
173
|
-
|
|
165
|
+
> Note: Cross-domain videos may belong to multiple categories, so category totals exceed 6,454.
|
|
174
166
|
|
|
175
|
-
|
|
176
|
-
|---|---|---|
|
|
177
|
-
| 6,454 video titles | Translation table shipped in the repository | Immediately after install |
|
|
178
|
-
| 166 category names | Shipped in the repository | Immediately after install |
|
|
179
|
-
| Summary, recommendation note, quoted comment | Translated when the page opens | Model first, machine translation as fallback |
|
|
180
|
-
| Hacker News comment bodies | Per comment or in bulk, on demand | About 1 second, then cached |
|
|
167
|
+
</details>
|
|
181
168
|
|
|
182
|
-
|
|
169
|
+
---
|
|
183
170
|
|
|
184
|
-
|
|
171
|
+
## ⚡ Architecture & Performance
|
|
185
172
|
|
|
186
|
-
|
|
173
|
+
- **Zero Runtime Dependencies**: Archive unpacking uses Node.js native `zlib`; no third-party npm packages required at runtime.
|
|
174
|
+
- **Latency Benchmarks**:
|
|
175
|
+
- Initial catalogue render: **~45 ms**
|
|
176
|
+
- Watch view open: **~10 ms**
|
|
177
|
+
- Co-recommendation query: **~2 ms**
|
|
178
|
+
- Vector cosine neighbor search: **~0.7 s** on initial run, instant in-memory afterwards
|
|
179
|
+
- **Graceful Degradation**:
|
|
187
180
|
|
|
188
|
-
|
|
|
181
|
+
| Module | Requirements | Behavior When Missing / Offline |
|
|
189
182
|
|---|---|---|
|
|
190
|
-
|
|
|
191
|
-
| Chinese
|
|
192
|
-
|
|
|
193
|
-
| AI
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
197
|
-
Both `yt-dlp` and `ffmpeg` are optional. They affect two things only, whether AI answers can use subtitles and whether playback can fall back to a direct stream when YouTube refuses the embed.
|
|
198
|
-
|
|
199
|
-
## Data source
|
|
183
|
+
| **Browsing & Basic Playback** | DSH Web Container & Network | Local offline search remains available |
|
|
184
|
+
| **Chinese Titles & Categories** | None | Shipped with repo, 100% offline available |
|
|
185
|
+
| **Summaries & Comment Translation** | Model or Translation Endpoint | Automatically falls back to English source |
|
|
186
|
+
| **AI Q&A** | Configured DSH model | Warns model unavailable; playback unaffected |
|
|
187
|
+
| **Subtitle Extraction** | Optional `yt-dlp` + `ffmpeg` | AI answers lose subtitle context; playback unaffected |
|
|
188
|
+
| **Alternative Mirror** | Domestic platform connectivity | Hides button silently; normal playback unaffected |
|
|
200
189
|
|
|
201
|
-
|
|
190
|
+
<details>
|
|
191
|
+
<summary><b>📁 Data Source & Local Cache Directory Layout</b></summary>
|
|
202
192
|
|
|
203
|
-
|
|
204
|
-
videos.jsonl 6,454 videos with title, channel, summary, recommendation note, tags, categories, HN stats
|
|
205
|
-
mentions.jsonl 39,834 HN comments with author, month, stance, and body
|
|
206
|
-
related.jsonl 3,778 co-recommendation rows
|
|
207
|
-
embeddings.npy 6,454 × 384 float16 vectors, used to fill in videos without co-recommendation data
|
|
208
|
-
embedding_ids.json Row index to video id
|
|
209
|
-
taxonomy.json 150 categories in 16 areas
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Unpacking uses the zlib module built into Node, so the plugin ships with no npm runtime dependencies.
|
|
213
|
-
|
|
214
|
-
The export has no duration, view count, publish date, or thumbnail, since those are YouTube metadata. The list therefore still requests 65 upstream pages in parallel to fill them in, cached for one day.
|
|
193
|
+
<br />
|
|
215
194
|
|
|
216
|
-
|
|
195
|
+
Cached under `$DSH_PROFILE_DIR/.dsh-hackertube/` (default: `~/.dsh/.dsh-hackertube/`):
|
|
217
196
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
i18n/zh-comments.json Comment translation cache
|
|
227
|
-
list.json YouTube metadata and list snapshot
|
|
228
|
-
prefs.json Likes, watch later, history
|
|
229
|
-
subs/ Subtitles
|
|
197
|
+
```text
|
|
198
|
+
.dsh-hackertube/
|
|
199
|
+
├── export/ # Unpacked official export (~48 MB: videos, mentions, embeddings.npy)
|
|
200
|
+
├── i18n/ # Translation caches (titles, taxonomy, model output, MT cache)
|
|
201
|
+
├── list.json # YouTube metadata snapshot (views, duration, dates)
|
|
202
|
+
├── prefs.json # Likes, watch later list, playback progress history
|
|
203
|
+
├── subs/ # On-demand subtitle files
|
|
204
|
+
└── mirror.json # Alternative mirror lookup cache
|
|
230
205
|
```
|
|
231
206
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Title translations are model output checked by rules. Most read naturally, and roughly a thousand remain close to word-for-word.
|
|
235
|
-
|
|
236
|
-
A Chinese query is machine translated into English before it can reach English tags. That costs one request per query, debounced by 300 ms and cached in memory. Offline, only local matching applies.
|
|
207
|
+
Delete this directory at any time to reset to a pristine state.
|
|
237
208
|
|
|
238
|
-
|
|
209
|
+
</details>
|
|
239
210
|
|
|
240
|
-
|
|
211
|
+
---
|
|
241
212
|
|
|
242
|
-
## Credits
|
|
213
|
+
## 📌 Credits & Disclaimer
|
|
243
214
|
|
|
244
|
-
|
|
215
|
+
- Core data is powered by the [HackerTube](https://karpathy.bearblog.dev/hacker-tube/) project created by **[Andrej Karpathy](https://github.com/karpathy)**.
|
|
216
|
+
- Discussion snippets originate from [Hacker News](https://news.ycombinator.com). Video content copyright belongs to respective YouTube creators.
|
|
217
|
+
- This is an independent open-source plugin and is not officially affiliated with Andrej Karpathy, Hacker News, or YouTube.
|
|
245
218
|
|
|
246
|
-
|
|
219
|
+
---
|
|
247
220
|
|
|
248
|
-
## License
|
|
221
|
+
## 📄 License
|
|
249
222
|
|
|
250
|
-
MIT
|
|
223
|
+
[MIT License](LICENSE) © 2026
|