Skip to content

Commit 39b39b5

Browse files
committed
init: basic youtube download implemented
0 parents  commit 39b39b5

File tree

19 files changed

+3416
-0
lines changed

19 files changed

+3416
-0
lines changed

.gitignore

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
2+
3+
# Logs
4+
5+
logs
6+
_.log
7+
npm-debug.log_
8+
yarn-debug.log*
9+
yarn-error.log*
10+
lerna-debug.log*
11+
.pnpm-debug.log*
12+
13+
# Caches
14+
15+
.cache
16+
17+
# Diagnostic reports (https://nodejs.org/api/report.html)
18+
19+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
20+
21+
# Runtime data
22+
23+
pids
24+
_.pid
25+
_.seed
26+
*.pid.lock
27+
28+
# Directory for instrumented libs generated by jscoverage/JSCover
29+
30+
lib-cov
31+
32+
# Coverage directory used by tools like istanbul
33+
34+
coverage
35+
*.lcov
36+
37+
# nyc test coverage
38+
39+
.nyc_output
40+
41+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
42+
43+
.grunt
44+
45+
# Bower dependency directory (https://bower.io/)
46+
47+
bower_components
48+
49+
# node-waf configuration
50+
51+
.lock-wscript
52+
53+
# Compiled binary addons (https://nodejs.org/api/addons.html)
54+
55+
build/Release
56+
57+
# Dependency directories
58+
59+
node_modules/
60+
jspm_packages/
61+
62+
# Snowpack dependency directory (https://snowpack.dev/)
63+
64+
web_modules/
65+
66+
# TypeScript cache
67+
68+
*.tsbuildinfo
69+
70+
# Optional npm cache directory
71+
72+
.npm
73+
74+
# Optional eslint cache
75+
76+
.eslintcache
77+
78+
# Optional stylelint cache
79+
80+
.stylelintcache
81+
82+
# Microbundle cache
83+
84+
.rpt2_cache/
85+
.rts2_cache_cjs/
86+
.rts2_cache_es/
87+
.rts2_cache_umd/
88+
89+
# Optional REPL history
90+
91+
.node_repl_history
92+
93+
# Output of 'npm pack'
94+
95+
*.tgz
96+
97+
# Yarn Integrity file
98+
99+
.yarn-integrity
100+
101+
# dotenv environment variable files
102+
103+
.env
104+
.env.development.local
105+
.env.test.local
106+
.env.production.local
107+
.env.local
108+
109+
# parcel-bundler cache (https://parceljs.org/)
110+
111+
.parcel-cache
112+
113+
# Next.js build output
114+
115+
.next
116+
out
117+
118+
# Nuxt.js build / generate output
119+
120+
.nuxt
121+
dist
122+
123+
# Gatsby files
124+
125+
# Comment in the public line in if your project uses Gatsby and not Next.js
126+
127+
# https://nextjs.org/blog/next-9-1#public-directory-support
128+
129+
# public
130+
131+
# vuepress build output
132+
133+
.vuepress/dist
134+
135+
# vuepress v2.x temp and cache directory
136+
137+
.temp
138+
139+
# Docusaurus cache and generated files
140+
141+
.docusaurus
142+
143+
# Serverless directories
144+
145+
.serverless/
146+
147+
# FuseBox cache
148+
149+
.fusebox/
150+
151+
# DynamoDB Local files
152+
153+
.dynamodb/
154+
155+
# TernJS port file
156+
157+
.tern-port
158+
159+
# Stores VSCode versions used for testing VSCode extensions
160+
161+
.vscode-test
162+
163+
# yarn v2
164+
165+
.yarn/cache
166+
.yarn/unplugged
167+
.yarn/build-state.yml
168+
.yarn/install-state.gz
169+
.pnp.*
170+
171+
# IntelliJ based IDEs
172+
.idea
173+
174+
# Finder (MacOS) folder config
175+
.DS_Store
176+
extensions_support/
177+
178+
*.mp4

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# template-ext-worker
2+
3+
## 0.0.5
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @kksh/api@0.0.53
9+
10+
## 0.0.4
11+
12+
### Patch Changes
13+
14+
- Updated dependencies
15+
- @kksh/api@0.0.48
16+
17+
## 0.0.3
18+
19+
### Patch Changes
20+
21+
- Updated dependencies
22+
- @kksh/api@0.0.47

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Kunkun YouTube Downloader Extension
2+
3+
This extension allows you to download videos from YouTube.
4+

build.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { watch } from "fs"
2+
import { join } from "path"
3+
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
4+
import { $ } from "bun"
5+
6+
const entrypoints = ["./src/index.ts"]
7+
8+
async function build() {
9+
try {
10+
for (const entrypoint of entrypoints) {
11+
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
12+
}
13+
if (Bun.argv.includes("dev")) {
14+
await refreshTemplateWorkerExtension()
15+
}
16+
} catch (error) {
17+
console.error(error)
18+
}
19+
}
20+
21+
const srcDir = join(import.meta.dir, "src")
22+
23+
await build()
24+
25+
if (Bun.argv.includes("dev")) {
26+
console.log(`Watching ${srcDir} for changes...`)
27+
watch(srcDir, { recursive: true }, async (event, filename) => {
28+
await build()
29+
})
30+
}

bun.lock

Lines changed: 609 additions & 0 deletions
Large diffs are not rendered by default.

deno-src/deno.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"tasks": {
3+
"dev": "deno run --watch main.ts"
4+
},
5+
"imports": {
6+
"@distube/yt-dlp": "npm:@distube/yt-dlp@^2.0.1",
7+
"@distube/ytdl-core": "npm:@distube/ytdl-core@^4.15.9",
8+
"@hk/photographer-toolbox": "jsr:@hk/photographer-toolbox@^0.1.12",
9+
"@kunkun/api": "jsr:@kunkun/api@^0.0.52",
10+
"@std/assert": "jsr:@std/assert@1",
11+
"fluent-ffmpeg": "npm:fluent-ffmpeg@^2.1.3"
12+
}
13+
}

0 commit comments

Comments
 (0)