dsh-hackertube 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.en.md +154 -0
- package/README.md +153 -2
- package/client.js +2568 -0
- package/cordis.patch.yml +5 -0
- package/data/zh-taxonomy.json +1 -0
- package/data/zh-titles.json +1 -0
- package/icon.svg +5 -0
- package/index.js +3142 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-hackertube contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# HackerTube for DeepSeek Harness
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
Browse and watch the videos Hacker News has recommended over two decades, without leaving the DeepSeek Harness panel. A high-quality English video library within reach, which makes the harness a richer and more enjoyable place to work.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
The dataset comes from [HackerTube](https://karpathy.bearblog.dev/hacker-tube/) by Andrej Karpathy. The site ships a complete data export, and the author describes its purpose in his post:
|
|
10
|
+
|
|
11
|
+
> Export of the site's data available to give to your agent to easily create your own version.
|
|
12
|
+
|
|
13
|
+
This plugin consumes that official export. It is an unofficial project and is not affiliated with Andrej Karpathy, Hacker News, or YouTube.
|
|
14
|
+
|
|
15
|
+
The original site works fine on its own. Moving it into the panel changes two things. You no longer switch windows, and the interface is fully available in Chinese, including titles, categories, summaries, and comments.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Requires DeepSeek Harness.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
plugin_manager install_bundle target=dsh-hackertube
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If the package is not on npm yet, install from the Git repository. How the host parses the install argument depends on its version, so fall back to the command above if this one fails.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
plugin_manager install_bundle target=github:chow651/dsh-hackertube
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
After installing, enable `dsh-hackertube` in the plugin list and refresh the page. No configuration, no API key, and no data to fetch beforehand.
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
The panel holds 6,454 videos across 16 areas and 150 categories, ordered by how strongly Hacker News recommends them. The home grid loads 60 cards at first and appends more as you scroll.
|
|
38
|
+
|
|
39
|
+
The watch page has the player, the Hacker News discussion for that video, and a related rail on the right. The rail has a second pane for AI questions. It hands the model the subtitle lines within three minutes of the current playhead, so you can ask what a particular segment covers.
|
|
40
|
+
|
|
41
|
+
Search works with English and Chinese queries. A Chinese query matches both the Chinese title and the English tags.
|
|
42
|
+
|
|
43
|
+
Likes, watch later, and history live on the host side, so clearing browser data does not lose them.
|
|
44
|
+
|
|
45
|
+
### Keyboard shortcuts
|
|
46
|
+
|
|
47
|
+
| Key | Action |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `/` | Focus the search field |
|
|
50
|
+
| `j` `k` | Move between cards |
|
|
51
|
+
| `Enter` | Open the focused card |
|
|
52
|
+
| `l` | Like |
|
|
53
|
+
| `w` | Add to watch later |
|
|
54
|
+
| `h` | Back to home |
|
|
55
|
+
| `?` | Show all shortcuts |
|
|
56
|
+
| `Esc` | Close overlay |
|
|
57
|
+
|
|
58
|
+
## First launch
|
|
59
|
+
|
|
60
|
+
The plugin starts downloading the official export as soon as it loads, 17.8 MB in one request, and at the same time requests upstream pages to fill in YouTube duration, view count, and publish date. The list is only complete once both finish. A skeleton screen covers the panel in the meantime.
|
|
61
|
+
|
|
62
|
+
| Scenario | Measured |
|
|
63
|
+
|---|---|
|
|
64
|
+
| First install, empty cache | about 10 seconds |
|
|
65
|
+
| Later launches, list load | 45 ms |
|
|
66
|
+
| Opening a watch page | 10 ms |
|
|
67
|
+
| Related, the 3,778 videos with co-recommendation data | 2 ms |
|
|
68
|
+
| Related, the other 2,676 videos, by vector similarity | about 0.7 s on first use |
|
|
69
|
+
| Machine translation of summary and recommendation note | 0.4 to 1.8 s on first use |
|
|
70
|
+
|
|
71
|
+
The export stays valid for seven days. YouTube metadata is cached for twenty-four hours.
|
|
72
|
+
|
|
73
|
+
## Chinese support
|
|
74
|
+
|
|
75
|
+
Every interface string goes through `tx(lang, 中文, English)`, so neither language mode shows mixed text. Number units follow the language, with 万 and 亿 in Chinese and K and M in English.
|
|
76
|
+
|
|
77
|
+
Content-level Chinese comes from four places.
|
|
78
|
+
|
|
79
|
+
| Content | Source | When it applies |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| 6,454 video titles | Translation table shipped in the repository | Immediately after install |
|
|
82
|
+
| 166 category names | Shipped in the repository | Immediately after install |
|
|
83
|
+
| Summary, recommendation note, quoted comment | Translated when the page opens | Model first, machine translation as fallback |
|
|
84
|
+
| Hacker News comment bodies | Per comment or in bulk, on demand | About 1 second, then cached |
|
|
85
|
+
|
|
86
|
+
Model output and machine translation are stored separately. Once a model is configured, its translations replace the machine output rather than being blocked by it.
|
|
87
|
+
|
|
88
|
+
Machine translation uses the public Google web translate endpoint. Comment bodies stay in English by default. Translation is an explicit action.
|
|
89
|
+
|
|
90
|
+
## Dependencies and degradation
|
|
91
|
+
|
|
92
|
+
| Capability | Requires | Without it |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| List, categories, search, playback | The DSH web server and network access | The panel or the player does not load |
|
|
95
|
+
| Chinese titles and category names | Nothing | Shipped with the repository |
|
|
96
|
+
| Chinese for summary and the other two fields | A model or network access | English source text is shown |
|
|
97
|
+
| AI questions | A model configured in DSH | The panel reports the model is unavailable, everything else works |
|
|
98
|
+
| Comment translation | Network access | The button does nothing and the text stays as written |
|
|
99
|
+
| Subtitles and direct-stream fallback | `yt-dlp` and `ffmpeg` on PATH | Video still plays, the AI answers lose subtitle context |
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
## Data source
|
|
104
|
+
|
|
105
|
+
`https://hackertube.org/download/hackertube-data.zip`, 17.8 MB, exported on 31 October 2026.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
videos.jsonl 6,454 videos with title, channel, summary, recommendation note, tags, categories, HN stats
|
|
109
|
+
mentions.jsonl 39,834 HN comments with author, month, stance, and body
|
|
110
|
+
related.jsonl 3,778 co-recommendation rows
|
|
111
|
+
embeddings.npy 6,454 × 384 float16 vectors, used to fill in videos without co-recommendation data
|
|
112
|
+
embedding_ids.json Row index to video id
|
|
113
|
+
taxonomy.json 150 categories in 16 areas
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Unpacking uses the zlib module built into Node, so the plugin ships with no npm runtime dependencies.
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
## Cache
|
|
121
|
+
|
|
122
|
+
Everything lives under `$DSH_PROFILE_DIR/.dsh-hackertube/`, by default `~/.dsh/.dsh-hackertube/`. Deleting the directory resets the plugin to a clean state.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
export/ Unpacked official data, about 48 MB
|
|
126
|
+
i18n/zh-titles.json Title translations
|
|
127
|
+
i18n/zh-taxonomy.json Category translations
|
|
128
|
+
i18n/zh.json Model translations for detail text
|
|
129
|
+
i18n/zh-mt.json Machine translations for detail text
|
|
130
|
+
i18n/zh-comments.json Comment translation cache
|
|
131
|
+
list.json YouTube metadata and list snapshot
|
|
132
|
+
prefs.json Likes, watch later, history
|
|
133
|
+
subs/ Subtitles
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Known limitations
|
|
137
|
+
|
|
138
|
+
Title translations are model output checked by rules. Most read naturally, and roughly a thousand remain close to word-for-word.
|
|
139
|
+
|
|
140
|
+
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.
|
|
141
|
+
|
|
142
|
+
YouTube embeds follow upstream policy. Age-restricted and region-restricted videos are only available on YouTube.
|
|
143
|
+
|
|
144
|
+
The playback relay listens on `127.0.0.1:18090`, falling back to 18091 and 18092 when the port is taken.
|
|
145
|
+
|
|
146
|
+
## Credits
|
|
147
|
+
|
|
148
|
+
Thanks to Andrej Karpathy for building HackerTube and for publishing its data export. This plugin builds on that work.
|
|
149
|
+
|
|
150
|
+
Discussion content comes from [Hacker News](https://news.ycombinator.com). Videos are hosted on YouTube.
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# HackerTube for DeepSeek Harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
简体中文 | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
在 DSH 面板内浏览并播放 Hacker News 二十年间反复推荐的技术视频,无需切换到浏览器。触手可及的高质量英文视频信源,让你的 DeepSeek Harness 变得更丰富有趣。
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
数据集来自 Andrej Karpathy 的 [HackerTube](https://karpathy.bearblog.dev/hacker-tube/)。站点提供完整的数据导出,作者在博客中说明其用途:
|
|
10
|
+
|
|
11
|
+
> Export of the site's data available to give to your agent to easily create your own version.
|
|
12
|
+
|
|
13
|
+
本插件使用的正是这份官方导出。非官方项目,与 Andrej Karpathy、Hacker News、YouTube 均无隶属关系。
|
|
14
|
+
|
|
15
|
+
原站同样可以直接访问。将其并入面板带来两点差异:一是省去窗口切换,二是提供完整的中文支持,包括标题、分类、摘要与评论。
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
需要已安装 DeepSeek Harness 本体。
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
plugin_manager install_bundle target=dsh-hackertube
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
未发布到 npm 时,可从 Git 仓库安装。宿主如何解析安装参数取决于版本,失败时改用上一条命令。
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
plugin_manager install_bundle target=github:chow651/dsh-hackertube
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
安装后在插件列表中启用 `dsh-hackertube` 并刷新页面。无需额外配置,无需 API key,也不需要在安装前预取任何数据。
|
|
32
|
+
|
|
33
|
+
## 功能
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
收录 6454 个视频,分属 16 个大类与 150 个二级分类,按 HN 推荐力度排序。首页首次加载 60 条,滚动时分批追加。
|
|
38
|
+
|
|
39
|
+
详情页包含播放器、该视频在 HN 上的讨论,以及右侧的相关推荐。右侧另有 AI 问答页,会把当前播放位置前后三分钟的字幕片段一并交给模型,因此可以询问某一段的具体内容。
|
|
40
|
+
|
|
41
|
+
搜索支持中英文混用,中文查询会同时匹配中文标题与英文标签。
|
|
42
|
+
|
|
43
|
+
喜欢、稍后看与播放历史记录在宿主侧,清除浏览器数据不会丢失。
|
|
44
|
+
|
|
45
|
+
### 快捷键
|
|
46
|
+
|
|
47
|
+
| 按键 | 作用 |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `/` | 聚焦搜索框 |
|
|
50
|
+
| `j` `k` | 在卡片间上下移动 |
|
|
51
|
+
| `Enter` | 打开当前卡片 |
|
|
52
|
+
| `l` | 标记喜欢 |
|
|
53
|
+
| `w` | 加入稍后看 |
|
|
54
|
+
| `h` | 返回首页 |
|
|
55
|
+
| `?` | 显示快捷键一览 |
|
|
56
|
+
| `Esc` | 关闭浮层 |
|
|
57
|
+
|
|
58
|
+
## 首次启动
|
|
59
|
+
|
|
60
|
+
插件加载时即开始下载官方数据导出(17.8 MB,一次性),并同时请求上游接口补齐 YouTube 的时长、播放量与发布时间。两者完成后列表才是完整状态,期间界面显示骨架屏。
|
|
61
|
+
|
|
62
|
+
| 项目 | 实测耗时 |
|
|
63
|
+
|---|---|
|
|
64
|
+
| 首次安装(空缓存) | 约 10 秒 |
|
|
65
|
+
| 后续启动,列表加载 | 45 毫秒 |
|
|
66
|
+
| 打开详情页 | 10 毫秒 |
|
|
67
|
+
| 相关推荐,有共推荐关系的 3778 个视频 | 2 毫秒 |
|
|
68
|
+
| 相关推荐,其余 2676 个视频(向量近邻) | 首次约 0.7 秒 |
|
|
69
|
+
| 摘要与推荐理由机翻 | 首次 0.4 至 1.8 秒 |
|
|
70
|
+
|
|
71
|
+
数据导出有效期为七天,YouTube 元信息缓存二十四小时。
|
|
72
|
+
|
|
73
|
+
## 中文支持
|
|
74
|
+
|
|
75
|
+
界面文案统一通过 `tx(lang, 中文, English)` 输出,两种语言下均不会出现中英混排。数量单位随语言切换,中文使用万与亿,英文使用 K 与 M。
|
|
76
|
+
|
|
77
|
+
内容层面的中文来源如下。
|
|
78
|
+
|
|
79
|
+
| 内容 | 来源 | 生效时机 |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| 6454 条视频标题 | 随仓库附带的译文表 | 安装后立即生效 |
|
|
82
|
+
| 166 条分类名称 | 随仓库附带 | 安装后立即生效 |
|
|
83
|
+
| 摘要、推荐理由、评论引用 | 打开时自动翻译 | 优先使用模型,模型不可用时使用机翻 |
|
|
84
|
+
| HN 评论正文 | 逐条翻译或整段翻译 | 首次约 1 秒,之后读取缓存 |
|
|
85
|
+
|
|
86
|
+
模型译文与机翻译文分别存放。配置模型后,模型译文会覆盖机翻结果,不会因机翻先行而无法更新。
|
|
87
|
+
|
|
88
|
+
机翻调用 Google 网页翻译的公共端点。评论正文默认保持英文原文,翻译为显式操作。
|
|
89
|
+
|
|
90
|
+
## 依赖与降级
|
|
91
|
+
|
|
92
|
+
| 能力 | 依赖 | 缺失时的表现 |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| 列表、分类、搜索、播放 | DSH 的 webServer 与外网 | 面板不可用或播放器无法加载 |
|
|
95
|
+
| 中文标题与分类名 | 无 | 已随仓库提供 |
|
|
96
|
+
| 摘要等三段文本的中文 | 模型或外网 | 显示英文原文 |
|
|
97
|
+
| AI 问答 | DSH 已配置模型 | 面板提示模型不可用,其余功能正常 |
|
|
98
|
+
| 评论翻译 | 外网 | 按钮无响应,文本保持原文 |
|
|
99
|
+
| 字幕与直链兜底播放 | PATH 中存在 yt-dlp 与 ffmpeg | 视频仍可播放,AI 缺少字幕上下文 |
|
|
100
|
+
|
|
101
|
+
yt-dlp 与 ffmpeg 均为可选。它们只影响两件事:AI 问答能否携带字幕上下文,以及 YouTube 嵌入被拒绝时能否回退到直链播放。
|
|
102
|
+
|
|
103
|
+
## 数据来源
|
|
104
|
+
|
|
105
|
+
`https://hackertube.org/download/hackertube-data.zip`,17.8 MB,导出于 2026 年 10 月 31 日。
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
videos.jsonl 6454 条视频,含标题、频道、摘要、推荐理由、标签、分类、HN 统计
|
|
109
|
+
mentions.jsonl 39834 条 HN 评论,含作者、月份、立场、原文
|
|
110
|
+
related.jsonl 3778 条共推荐关系
|
|
111
|
+
embeddings.npy 6454 × 384 维 float16 向量,用于补齐无共推荐关系的视频
|
|
112
|
+
embedding_ids.json 向量行号与视频 id 的对应
|
|
113
|
+
taxonomy.json 150 个分类,16 个大类
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
解压使用 Node 内置的 zlib,插件不引入任何 npm 运行时依赖。
|
|
117
|
+
|
|
118
|
+
导出不包含时长、播放量、发布时间与封面,这些字段属于 YouTube 元数据,因此列表仍会并行请求 65 页上游接口补齐,结果缓存一天。
|
|
119
|
+
|
|
120
|
+
## 缓存目录
|
|
121
|
+
|
|
122
|
+
全部位于 `$DSH_PROFILE_DIR/.dsh-hackertube/`,默认路径为 `~/.dsh/.dsh-hackertube/`。删除整个目录可恢复到初始状态。
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
export/ 解包后的官方数据,约 48 MB
|
|
126
|
+
i18n/zh-titles.json 标题译文
|
|
127
|
+
i18n/zh-taxonomy.json 分类译文
|
|
128
|
+
i18n/zh.json 模型翻译的详情文本
|
|
129
|
+
i18n/zh-mt.json 机翻的详情文本
|
|
130
|
+
i18n/zh-comments.json 评论机翻缓存
|
|
131
|
+
list.json YouTube 元信息与列表快照
|
|
132
|
+
prefs.json 喜欢、稍后看、历史
|
|
133
|
+
subs/ 字幕
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 已知限制
|
|
137
|
+
|
|
138
|
+
标题译文由模型生成后按规则校对,多数通顺,仍有约一千条偏向直译。
|
|
139
|
+
|
|
140
|
+
中文查询需要先机翻为英文才能命中英文标签,每次查询发起一次请求,含 300 毫秒防抖与内存缓存。断网时仅保留本地匹配。
|
|
141
|
+
|
|
142
|
+
YouTube 嵌入受上游策略限制,年龄限制或地区限制的视频需前往 YouTube 观看。
|
|
143
|
+
|
|
144
|
+
播放中转页监听 `127.0.0.1:18090`,端口被占用时依次尝试 18091 与 18092。
|
|
145
|
+
|
|
146
|
+
## 致谢
|
|
147
|
+
|
|
148
|
+
感谢 Andrej Karpathy 开发 HackerTube 并将数据导出公开,本插件建立在这份工作之上。
|
|
149
|
+
|
|
150
|
+
讨论内容来自 [Hacker News](https://news.ycombinator.com),视频托管于 YouTube。
|
|
151
|
+
|
|
152
|
+
## 许可
|
|
153
|
+
|
|
154
|
+
MIT
|