Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 150 additions & 64 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ import { prismjsPlugin } from '@vuepress/plugin-prismjs';
const __dirname = getDirname(import.meta.url)

export default defineUserConfig({
lang: 'en-US',
locales: {
'/': {
lang: 'en-US',
title: 'YouTube.js',
description: 'A JavaScript client for YouTube\'s private API, known as InnerTube.',
},
'/zh/': {
lang: 'zh-CN',
title: 'YouTube.js',
description: 'YouTube 私有 API(InnerTube)的 JavaScript 客户端',
},
},
head: [
['link', { rel: 'icon', href: '/images/favicon/favicon-32x32.png' }],
['link', { rel: 'icon', href: '/images/favicon/favicon-16x16.png' }],
Expand All @@ -25,80 +36,152 @@ export default defineUserConfig({
['meta', { property: 'og:locale', content: 'en_US' }],
['meta', { property: 'og:image', content: '/images/logo.png' }],
],
title: 'YouTube.js',
description: 'A JavaScript client for YouTube\'s private API, known as InnerTube.',
clientConfigFile: path.resolve(__dirname, 'client.js'),
theme: defaultTheme({
docsRepo: 'https://github.com/LuanRT/ytjs-docs',
docsBranch: 'main',
docsDir: 'docs',
contributors: false,
repo: 'https://github.com/LuanRT/YouTube.js',
navbar: [
{
text: 'Guide',
link: '/guide/'
},
{
text: 'Discord',
link: 'https://discord.gg/syDu7Yks54'
},
{
text: '❤️ Sponsor',
link: 'https://github.com/sponsors/LuanRT',
},
],
colorModeSwitch: true,
sidebar: {
'/guide/': [
{
title: 'Guide',
collapsable: false,
children: [
{
link: '/guide/',
text: 'Introduction'
},
{
link: '/guide/getting-started',
text: 'Getting Started'
},
{
link: '/guide/browser-usage',
text: 'Browser Usage'
},
{
link: '/guide/caching',
text: 'Caching'
},
locales: {
'/': {
selectLanguageName: 'English',
editLinkText: 'Edit this page',
navbar: [
{
text: 'Guide',
link: '/guide/'
},
{
text: 'Discord',
link: 'https://discord.gg/syDu7Yks54'
},
{
text: '❤️ Sponsor',
link: 'https://github.com/sponsors/LuanRT',
},
],
sidebar: {
'/guide/': [
{
link: '/guide/proxies',
text: 'Proxies'
},
{
link: '/guide/authentication',
text: 'Authentication'
},
{
link: '/guide/advanced-usage',
text: 'Advanced Usage'
},
{
link: '/guide/troubleshooting',
text: 'Troubleshooting'
},
title: 'Guide',
collapsable: false,
children: [
{
link: '/guide/',
text: 'Introduction'
},
{
link: '/guide/getting-started',
text: 'Getting Started'
},
{
link: '/guide/browser-usage',
text: 'Browser Usage'
},
{
link: '/guide/caching',
text: 'Caching'
},
{
link: '/guide/proxies',
text: 'Proxies'
},
{
link: '/guide/authentication',
text: 'Authentication'
},
{
link: '/guide/advanced-usage',
text: 'Advanced Usage'
},
{
link: '/guide/troubleshooting',
text: 'Troubleshooting'
},
{
link: '/guide/faq',
text: 'FAQ'
},
]
}
],
'/api/': [
],
'/googlevideo/': [
]
}
},
'/zh/': {
selectLanguageName: '简体中文',
editLinkText: '编辑此页',
navbar: [
{
text: '指南',
link: '/zh/guide/'
},
{
text: 'Discord',
link: 'https://discord.gg/syDu7Yks54'
},
{
text: '❤️ 赞助',
link: 'https://github.com/sponsors/LuanRT',
},
],
sidebar: {
'/zh/guide/': [
{
link: '/guide/faq',
text: 'FAQ'
},
title: '指南',
collapsable: false,
children: [
{
link: '/zh/guide/',
text: '介绍'
},
{
link: '/zh/guide/getting-started',
text: '快速开始'
},
{
link: '/zh/guide/browser-usage',
text: '浏览器使用'
},
{
link: '/zh/guide/caching',
text: '缓存'
},
{
link: '/zh/guide/proxies',
text: '代理'
},
{
link: '/zh/guide/authentication',
text: '身份验证'
},
{
link: '/zh/guide/advanced-usage',
text: '高级用法'
},
{
link: '/zh/guide/troubleshooting',
text: '故障排除'
},
{
link: '/zh/guide/faq',
text: '常见问题'
},
]
}
],
'/zh/api/': [
],
'/zh/googlevideo/': [
]
}
],
'/api/': [
],
'/googlevideo/': [
]
}
}
},
colorModeSwitch: true,
}),
plugins: [
prismjsPlugin({
Expand All @@ -113,6 +196,9 @@ export default defineUserConfig({
'/': {
placeholder: 'Search',
},
'/zh/': {
placeholder: '搜索',
},
},
}),
],
Expand Down
84 changes: 84 additions & 0 deletions docs/zh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
home: true
title: 首页
heroText: YouTube.js
heroImage: '/images/logo.png'
tagline: YouTube 私有 API 的 JavaScript 客户端
actions:
- text: 快速开始 →
link: /zh/guide/
type: primary
- text: API 文档
link: /zh/api/
type: secondary
features:
- title: 🚀 强大且灵活
details: 无限制访问 YouTube 数据。从简单搜索到复杂操作,应有尽有。
- title: 🛡️ 无需 API 密钥
details: 无需 API 密钥或配额限制。像 YouTube 网站一样使用私有 API。
- title: 🔌 平台无关
details: 兼容 Node.js、Deno 和现代浏览器。在任何 JavaScript 运行环境中使用。
footer: MIT 许可证 | 版权所有 © LuanRT
---

## 生态系统

<div class="project-grid">
<div class="project-card">
<h3>GoogleVideo</h3>
<p>用于处理 YouTube 专有视频流协议(UMP/SABR)的模块集合。</p>
<router-link to="/zh/googlevideo/" class="project-link">查看文档 →</router-link>
</div>

<div class="project-card">
<h3>扩展</h3>
<p>为 YouTube.js 添加额外功能,满足特定使用场景。</p>
<router-link to="/zh/guide/advanced-usage" class="project-link">了解更多 →</router-link>
</div>
</div>

<style>
.project-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}

.project-card {
border: 1px solid var(--vp-c-border);
border-radius: 8px;
padding: 1.5rem;
background: var(--vp-c-bg-light);
transition: all 0.3s ease;
}

.project-card:hover {
border-color: var(--vp-c-brand);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-card h3 {
margin-top: 0;
padding-top: 0;
color: var(--vp-c-brand);
}

.project-card p {
margin: 0.5rem 0 1rem;
color: var(--vp-c-text-mute);
}

.project-link {
display: inline-block;
margin-top: 1rem;
color: var(--vp-c-brand);
text-decoration: none;
font-weight: 500;
}

.project-link:hover {
text-decoration: underline;
}
</style>
30 changes: 30 additions & 0 deletions docs/zh/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# API 文档

API 技术文档主要包含代码、类型定义和接口说明,这些内容使用英文是开发者的标准实践。

为了保持文档的准确性和及时性,API 参考文档暂未提供中文翻译。

**请切换到英文版查看完整的 API 文档:**

👉 [查看英文 API 文档](/api/)

---

## 快速链接

- [Innertube 类](/api/classes/Innertube.md) - 主要的客户端类
- [Actions 类](/api/classes/Actions.md) - 执行 InnerTube 操作
- [Session 类](/api/classes/Session.md) - 会话管理
- [Parser 命名空间](/api/youtubei.js/namespaces/Parser/README.md) - 响应解析器
- [YTNodes 命名空间](/api/youtubei.js/namespaces/YTNodes/README.md) - YouTube 节点类型

## 主要命名空间

- [YT](/api/youtubei.js/namespaces/YT/README.md) - YouTube 相关类型
- [YTMusic](/api/youtubei.js/namespaces/YTMusic/README.md) - YouTube Music 相关类型
- [YTKids](/api/youtubei.js/namespaces/YTKids/README.md) - YouTube Kids 相关类型
- [YTShorts](/api/youtubei.js/namespaces/YTShorts/README.md) - YouTube Shorts 相关类型

---

如有疑问,请参考[指南部分](/zh/guide/)或加入我们的 [Discord 社区](https://discord.gg/syDu7Yks54)。
Loading