@pieda/video-dl 1.10.0 → 1.10.3
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/dist/video-dl.cjs +1 -1
- package/dist/video-dl.js +143 -178
- package/package.json +2 -2
package/dist/video-dl.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=(t=!1)=>({log:(...o)=>{t&&console.log(...o)},error:(...o)=>{t&&console.error(...o)}}),u=t=>new Promise((o,s)=>{import(t).then(r=>o(r.default)).catch(s)}),S=async(t,o,s)=>{const r=await u("fs"),e=await u("axios");return console.log(`Downloading ${t} to ${o}`),new Promise((i,n)=>{e.get(t,{responseType:"stream",headers:s}).then(a=>{const g=a.data,l=r.createWriteStream(o);g.pipe(l),l.on("finish",function(){l.close(()=>{i()})})}).catch(n)})},v=async({debug:t=!1,ytdlpPath:o,videoUrl:s,dest:r,tempDir:e,ffmpegConfig:i})=>{const n=d(t);n.log(`Downloading video: ${s} to: ${r}`);const a=await u("fs"),g=await u("path"),{exec:l,execSync:f}=await u("child_process"),w=()=>new Promise((c,m)=>{const p=`${o} -f mergeall --audio-multistreams --video-multistreams ${s} --downloader ffmpeg -o "${e}/%(id)s.%(ext)s" --merge-output-format mp4`;n.log(`[yt-dlp] 執行命令: ${p}`),l(p,(h,$,y)=>{if(n.log(`[yt-dlp] stdout: ${$}`),h){m(h);return}c()})});return a.existsSync(g.dirname(r))||(a.mkdirSync(g.dirname(r),{recursive:!0},777),n.log(`建立 ${g.dirname(r)}`)),new Promise(async(c,m)=>{try{await w();let p=!1;const h=a.readdirSync(e);for(const $ of h){const y=g.join(e,$),M=`${i.ffmpegProbePath} -v error -show_entries stream=codec_type -of csv=p=0 "${y}"`,k=f(M).toString("utf-8"),A=k.includes("video"),D=k.includes("audio");if(A&&D){p=!0,a.copyFileSync(y,r);break}}if(!p)throw new Error("無法下載影音正常的影片");n.log(`下載完成 ${r}`),c([null,!0])}catch(p){n.error(`下載失敗: ${p.message}`),c([p,null])}})},b=async({debug:t=!1,ytdlpPath:o,videoId:s,dest:r,tempDir:e,ffmpegConfig:i})=>{d(t).log(`Downloading video: ${s} to: ${r}`);const a=`https://www.youtube.com/watch?v=${s}`;return v({debug:t,ytdlpPath:o,videoUrl:a,dest:r,tempDir:e,ffmpegConfig:i})},P=async({videoId:t,dest:o,debug:s=!1,headless:r=!0})=>{try{const e=d(s);e.log(`Downloading video: ${t} to: ${o}`);const i=`https://m.facebook.com/watch/?v=${t}`,n=await u("fs"),a=await u("path"),g=await u("puppeteer");n.existsSync(a.dirname(o))||(n.mkdirSync(a.dirname(o),{recursive:!0},777),e.log(`建立 ${a.dirname(o)}`));const l={};r||(l.headless=!1);const f=await g.launch(l);e.log("啟動 puppeteer");const w=await f.newPage();await w.setUserAgent("'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1'"),e.log("開新分頁"),e.log(`前往 ${i}`),await Promise.race([w.goto(i,{waitUntil:"networkidle0"}),w.waitForSelector("video")]),e.log("找到 video 元素");const c=await w.$eval("video",m=>m.getAttribute("src"));return e.log(`取得 video url: ${c}`),await f.close(),e.log("關閉 puppeteer"),await S(c,o),e.log(`下載完成 ${c}`),[null,!0]}catch(e){return[e,null]}},U=async({debug:t=!1,ytdlpPath:o,videoId:s,dest:r,tempDir:e,ffmpegConfig:i})=>{d(t).log(`Downloading video: ${s} to: ${r}`);const a=`https://vimeo.com/${s}`;return v({debug:t,ytdlpPath:o,videoUrl:a,dest:r,tempDir:e,ffmpegConfig:i})},x=async({debug:t=!1,ytdlpPath:o,videoId:s,dest:r,tempDir:e,ffmpegConfig:i})=>{d(t).log(`Downloading video: ${s} to: ${r}`);const a=`https://www.instagram.com/reel/${s}/`;return v({debug:t,ytdlpPath:o,videoUrl:a,dest:r,tempDir:e,ffmpegConfig:i})},F=async({videoLink:t,dest:o,debug:s=!1,headless:r=!0})=>{try{const e=d(s);e.log(`Downloading video: ${t} to: ${o}`);const i=t,n=await u("fs"),a=await u("path"),g=await u("puppeteer");n.existsSync(a.dirname(o))||(n.mkdirSync(a.dirname(o),{recursive:!0},777),e.log(`建立 ${a.dirname(o)}`));const l={};r||(l.headless=!1);const f=await g.launch(l);e.log("啟動 puppeteer");const w=await f.newPage();e.log("開新分頁"),e.log(`前往 ${i}`),await Promise.race([w.goto(i,{waitUntil:"networkidle0"}),w.waitForSelector("video")]),e.log("找到 video 元素");const c=await w.$eval('video source[src^="https://www.tiktok.com/aweme/v1/play/"]',m=>m.getAttribute("src"));return e.log(`取得 video url: ${c}`),await f.close(),e.log("關閉 puppeteer"),await S(c,o,{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",Referer:"https://www.tiktok.com/"}),e.log(`下載完成 ${c}`),[null,!0]}catch(e){return[e,null]}},T=({type:t})=>{switch(t){case"youtube":case"yt-short":return b;case"facebook":case"fb-reel":return P;case"vimeo":return U;case"instagram":case"ig":case"ig-reel":return x;case"tiktok":case"tiktok-reel":return F;default:throw new Error(`Invalid video type: ${t}`)}};exports.useDownloader=T;exports.useFacebook=P;exports.useInstagram=x;exports.useTiktok=F;exports.useVimeo=U;exports.useYoutube=b;
|
package/dist/video-dl.js
CHANGED
|
@@ -1,244 +1,209 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = (t = !1) => ({
|
|
2
2
|
log: (...o) => {
|
|
3
|
-
|
|
3
|
+
t && console.log(...o);
|
|
4
4
|
},
|
|
5
5
|
error: (...o) => {
|
|
6
|
-
|
|
6
|
+
t && console.error(...o);
|
|
7
7
|
}
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
let k;
|
|
15
|
-
const R = new Uint8Array(16);
|
|
16
|
-
function V() {
|
|
17
|
-
if (!k) {
|
|
18
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
19
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
20
|
-
k = crypto.getRandomValues.bind(crypto);
|
|
21
|
-
}
|
|
22
|
-
return k(R);
|
|
23
|
-
}
|
|
24
|
-
const E = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), x = { randomUUID: E };
|
|
25
|
-
function T(e, o, r) {
|
|
26
|
-
var t;
|
|
27
|
-
e = e || {};
|
|
28
|
-
const n = e.random ?? ((t = e.rng) == null ? void 0 : t.call(e)) ?? V();
|
|
29
|
-
if (n.length < 16)
|
|
30
|
-
throw new Error("Random bytes length must be >= 16");
|
|
31
|
-
if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, o) {
|
|
32
|
-
if (r = r || 0, r < 0 || r + 16 > o.length)
|
|
33
|
-
throw new RangeError(`UUID byte range ${r}:${r + 15} is out of buffer bounds`);
|
|
34
|
-
for (let a = 0; a < 16; ++a)
|
|
35
|
-
o[r + a] = n[a];
|
|
36
|
-
return o;
|
|
37
|
-
}
|
|
38
|
-
return M(n);
|
|
39
|
-
}
|
|
40
|
-
function W(e, o, r) {
|
|
41
|
-
return x.randomUUID && !o && !e ? x.randomUUID() : T(e, o, r);
|
|
42
|
-
}
|
|
43
|
-
const w = (e) => new Promise((o, r) => {
|
|
44
|
-
import(e).then((n) => o(n.default)).catch(r);
|
|
45
|
-
}), D = async (e, o, r) => {
|
|
46
|
-
const n = await w("fs"), t = await w("axios");
|
|
47
|
-
return console.log(`Downloading ${e} to ${o}`), new Promise((a, c) => {
|
|
48
|
-
t.get(e, {
|
|
8
|
+
}), u = (t) => new Promise((o, n) => {
|
|
9
|
+
import(t).then((r) => o(r.default)).catch(n);
|
|
10
|
+
}), S = async (t, o, n) => {
|
|
11
|
+
const r = await u("fs"), e = await u("axios");
|
|
12
|
+
return console.log(`Downloading ${t} to ${o}`), new Promise((i, s) => {
|
|
13
|
+
e.get(t, {
|
|
49
14
|
responseType: "stream",
|
|
50
|
-
headers:
|
|
51
|
-
}).then((
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
15
|
+
headers: n
|
|
16
|
+
}).then((a) => {
|
|
17
|
+
const g = a.data, l = r.createWriteStream(o);
|
|
18
|
+
g.pipe(l), l.on("finish", function() {
|
|
19
|
+
l.close(() => {
|
|
20
|
+
i();
|
|
56
21
|
});
|
|
57
22
|
});
|
|
58
|
-
}).catch(
|
|
23
|
+
}).catch(s);
|
|
59
24
|
});
|
|
60
|
-
},
|
|
61
|
-
debug:
|
|
25
|
+
}, v = async ({
|
|
26
|
+
debug: t = !1,
|
|
62
27
|
ytdlpPath: o,
|
|
63
|
-
videoUrl:
|
|
64
|
-
dest:
|
|
65
|
-
tempDir:
|
|
66
|
-
ffmpegConfig:
|
|
28
|
+
videoUrl: n,
|
|
29
|
+
dest: r,
|
|
30
|
+
tempDir: e,
|
|
31
|
+
ffmpegConfig: i
|
|
67
32
|
}) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
|
|
33
|
+
const s = d(t);
|
|
34
|
+
s.log(`Downloading video: ${n} to: ${r}`);
|
|
35
|
+
const a = await u("fs"), g = await u("path"), { exec: l, execSync: f } = await u("child_process"), w = () => new Promise((c, m) => {
|
|
36
|
+
const p = `${o} -f mergeall --audio-multistreams --video-multistreams ${n} --downloader ffmpeg -o "${e}/%(id)s.%(ext)s" --merge-output-format mp4`;
|
|
37
|
+
s.log(`[yt-dlp] 執行命令: ${p}`), l(p, (h, $, y) => {
|
|
38
|
+
if (s.log(`[yt-dlp] stdout: ${$}`), h) {
|
|
39
|
+
m(h);
|
|
75
40
|
return;
|
|
76
41
|
}
|
|
77
|
-
|
|
42
|
+
c();
|
|
78
43
|
});
|
|
79
44
|
});
|
|
80
|
-
return
|
|
45
|
+
return a.existsSync(g.dirname(r)) || (a.mkdirSync(g.dirname(r), { recursive: !0 }, 777), s.log(`建立 ${g.dirname(r)}`)), new Promise(async (c, m) => {
|
|
81
46
|
try {
|
|
82
|
-
await
|
|
83
|
-
let
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
|
|
47
|
+
await w();
|
|
48
|
+
let p = !1;
|
|
49
|
+
const h = a.readdirSync(e);
|
|
50
|
+
for (const $ of h) {
|
|
51
|
+
const y = g.join(e, $), P = `${i.ffmpegProbePath} -v error -show_entries stream=codec_type -of csv=p=0 "${y}"`, k = f(P).toString("utf-8"), b = k.includes("video"), x = k.includes("audio");
|
|
52
|
+
if (b && x) {
|
|
53
|
+
p = !0, a.copyFileSync(y, r);
|
|
89
54
|
break;
|
|
90
55
|
}
|
|
91
56
|
}
|
|
92
|
-
if (!
|
|
57
|
+
if (!p)
|
|
93
58
|
throw new Error("無法下載影音正常的影片");
|
|
94
|
-
|
|
95
|
-
} catch (
|
|
96
|
-
|
|
59
|
+
s.log(`下載完成 ${r}`), c([null, !0]);
|
|
60
|
+
} catch (p) {
|
|
61
|
+
s.error(`下載失敗: ${p.message}`), c([p, null]);
|
|
97
62
|
}
|
|
98
63
|
});
|
|
99
|
-
},
|
|
100
|
-
debug:
|
|
64
|
+
}, U = async ({
|
|
65
|
+
debug: t = !1,
|
|
101
66
|
ytdlpPath: o,
|
|
102
|
-
videoId:
|
|
103
|
-
dest:
|
|
104
|
-
tempDir:
|
|
105
|
-
ffmpegConfig:
|
|
67
|
+
videoId: n,
|
|
68
|
+
dest: r,
|
|
69
|
+
tempDir: e,
|
|
70
|
+
ffmpegConfig: i
|
|
106
71
|
}) => {
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
return
|
|
110
|
-
debug:
|
|
72
|
+
d(t).log(`Downloading video: ${n} to: ${r}`);
|
|
73
|
+
const a = `https://www.youtube.com/watch?v=${n}`;
|
|
74
|
+
return v({
|
|
75
|
+
debug: t,
|
|
111
76
|
ytdlpPath: o,
|
|
112
|
-
videoUrl:
|
|
113
|
-
dest:
|
|
114
|
-
tempDir:
|
|
115
|
-
ffmpegConfig:
|
|
77
|
+
videoUrl: a,
|
|
78
|
+
dest: r,
|
|
79
|
+
tempDir: e,
|
|
80
|
+
ffmpegConfig: i
|
|
116
81
|
});
|
|
117
|
-
},
|
|
118
|
-
videoId:
|
|
82
|
+
}, A = async ({
|
|
83
|
+
videoId: t,
|
|
119
84
|
dest: o,
|
|
120
|
-
debug:
|
|
121
|
-
headless:
|
|
85
|
+
debug: n = !1,
|
|
86
|
+
headless: r = !0
|
|
122
87
|
}) => {
|
|
123
88
|
try {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
await
|
|
89
|
+
const e = d(n);
|
|
90
|
+
e.log(`Downloading video: ${t} to: ${o}`);
|
|
91
|
+
const i = `https://m.facebook.com/watch/?v=${t}`, s = await u("fs"), a = await u("path"), g = await u("puppeteer");
|
|
92
|
+
s.existsSync(a.dirname(o)) || (s.mkdirSync(a.dirname(o), { recursive: !0 }, 777), e.log(`建立 ${a.dirname(o)}`));
|
|
93
|
+
const l = {};
|
|
94
|
+
r || (l.headless = !1);
|
|
95
|
+
const f = await g.launch(l);
|
|
96
|
+
e.log("啟動 puppeteer");
|
|
97
|
+
const w = await f.newPage();
|
|
98
|
+
await w.setUserAgent(
|
|
134
99
|
"'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1'"
|
|
135
|
-
),
|
|
136
|
-
|
|
100
|
+
), e.log("開新分頁"), e.log(`前往 ${i}`), await Promise.race([
|
|
101
|
+
w.goto(i, {
|
|
137
102
|
waitUntil: "networkidle0"
|
|
138
103
|
}),
|
|
139
|
-
|
|
140
|
-
]),
|
|
141
|
-
const
|
|
142
|
-
return
|
|
143
|
-
} catch (
|
|
144
|
-
return [
|
|
104
|
+
w.waitForSelector("video")
|
|
105
|
+
]), e.log("找到 video 元素");
|
|
106
|
+
const c = await w.$eval("video", (m) => m.getAttribute("src"));
|
|
107
|
+
return e.log(`取得 video url: ${c}`), await f.close(), e.log("關閉 puppeteer"), await S(c, o), e.log(`下載完成 ${c}`), [null, !0];
|
|
108
|
+
} catch (e) {
|
|
109
|
+
return [e, null];
|
|
145
110
|
}
|
|
146
|
-
},
|
|
147
|
-
debug:
|
|
111
|
+
}, F = async ({
|
|
112
|
+
debug: t = !1,
|
|
148
113
|
ytdlpPath: o,
|
|
149
|
-
videoId:
|
|
150
|
-
dest:
|
|
151
|
-
tempDir:
|
|
152
|
-
ffmpegConfig:
|
|
114
|
+
videoId: n,
|
|
115
|
+
dest: r,
|
|
116
|
+
tempDir: e,
|
|
117
|
+
ffmpegConfig: i
|
|
153
118
|
}) => {
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
debug:
|
|
119
|
+
d(t).log(`Downloading video: ${n} to: ${r}`);
|
|
120
|
+
const a = `https://vimeo.com/${n}`;
|
|
121
|
+
return v({
|
|
122
|
+
debug: t,
|
|
158
123
|
ytdlpPath: o,
|
|
159
|
-
videoUrl:
|
|
160
|
-
dest:
|
|
161
|
-
tempDir:
|
|
162
|
-
ffmpegConfig:
|
|
124
|
+
videoUrl: a,
|
|
125
|
+
dest: r,
|
|
126
|
+
tempDir: e,
|
|
127
|
+
ffmpegConfig: i
|
|
163
128
|
});
|
|
164
|
-
},
|
|
165
|
-
debug:
|
|
129
|
+
}, M = async ({
|
|
130
|
+
debug: t = !1,
|
|
166
131
|
ytdlpPath: o,
|
|
167
|
-
videoId:
|
|
168
|
-
dest:
|
|
169
|
-
tempDir:
|
|
170
|
-
ffmpegConfig:
|
|
132
|
+
videoId: n,
|
|
133
|
+
dest: r,
|
|
134
|
+
tempDir: e,
|
|
135
|
+
ffmpegConfig: i
|
|
171
136
|
}) => {
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
return
|
|
175
|
-
debug:
|
|
137
|
+
d(t).log(`Downloading video: ${n} to: ${r}`);
|
|
138
|
+
const a = `https://www.instagram.com/reel/${n}/`;
|
|
139
|
+
return v({
|
|
140
|
+
debug: t,
|
|
176
141
|
ytdlpPath: o,
|
|
177
|
-
videoUrl:
|
|
178
|
-
dest:
|
|
179
|
-
tempDir:
|
|
180
|
-
ffmpegConfig:
|
|
142
|
+
videoUrl: a,
|
|
143
|
+
dest: r,
|
|
144
|
+
tempDir: e,
|
|
145
|
+
ffmpegConfig: i
|
|
181
146
|
});
|
|
182
|
-
},
|
|
183
|
-
videoLink:
|
|
147
|
+
}, D = async ({
|
|
148
|
+
videoLink: t,
|
|
184
149
|
dest: o,
|
|
185
|
-
debug:
|
|
186
|
-
headless:
|
|
150
|
+
debug: n = !1,
|
|
151
|
+
headless: r = !0
|
|
187
152
|
}) => {
|
|
188
153
|
try {
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
154
|
+
const e = d(n);
|
|
155
|
+
e.log(`Downloading video: ${t} to: ${o}`);
|
|
156
|
+
const i = t, s = await u("fs"), a = await u("path"), g = await u("puppeteer");
|
|
157
|
+
s.existsSync(a.dirname(o)) || (s.mkdirSync(a.dirname(o), { recursive: !0 }, 777), e.log(`建立 ${a.dirname(o)}`));
|
|
158
|
+
const l = {};
|
|
159
|
+
r || (l.headless = !1);
|
|
160
|
+
const f = await g.launch(l);
|
|
161
|
+
e.log("啟動 puppeteer");
|
|
162
|
+
const w = await f.newPage();
|
|
163
|
+
e.log("開新分頁"), e.log(`前往 ${i}`), await Promise.race([
|
|
164
|
+
w.goto(i, {
|
|
200
165
|
waitUntil: "networkidle0"
|
|
201
166
|
}),
|
|
202
|
-
|
|
203
|
-
]),
|
|
204
|
-
const
|
|
167
|
+
w.waitForSelector("video")
|
|
168
|
+
]), e.log("找到 video 元素");
|
|
169
|
+
const c = await w.$eval(
|
|
205
170
|
'video source[src^="https://www.tiktok.com/aweme/v1/play/"]',
|
|
206
|
-
(
|
|
171
|
+
(m) => m.getAttribute("src")
|
|
207
172
|
);
|
|
208
|
-
return
|
|
173
|
+
return e.log(`取得 video url: ${c}`), await f.close(), e.log("關閉 puppeteer"), await S(c, o, {
|
|
209
174
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
|
210
175
|
Referer: "https://www.tiktok.com/"
|
|
211
176
|
// 設定 Referer
|
|
212
|
-
}),
|
|
213
|
-
} catch (
|
|
214
|
-
return [
|
|
177
|
+
}), e.log(`下載完成 ${c}`), [null, !0];
|
|
178
|
+
} catch (e) {
|
|
179
|
+
return [e, null];
|
|
215
180
|
}
|
|
216
|
-
},
|
|
217
|
-
switch (
|
|
181
|
+
}, T = ({ type: t }) => {
|
|
182
|
+
switch (t) {
|
|
218
183
|
case "youtube":
|
|
219
184
|
case "yt-short":
|
|
220
|
-
return
|
|
185
|
+
return U;
|
|
221
186
|
case "facebook":
|
|
222
187
|
case "fb-reel":
|
|
223
|
-
return
|
|
188
|
+
return A;
|
|
224
189
|
case "vimeo":
|
|
225
|
-
return
|
|
190
|
+
return F;
|
|
226
191
|
case "instagram":
|
|
227
192
|
case "ig":
|
|
228
193
|
case "ig-reel":
|
|
229
|
-
return
|
|
194
|
+
return M;
|
|
230
195
|
case "tiktok":
|
|
231
196
|
case "tiktok-reel":
|
|
232
|
-
return
|
|
197
|
+
return D;
|
|
233
198
|
default:
|
|
234
|
-
throw new Error(`Invalid video type: ${
|
|
199
|
+
throw new Error(`Invalid video type: ${t}`);
|
|
235
200
|
}
|
|
236
201
|
};
|
|
237
202
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
203
|
+
T as useDownloader,
|
|
204
|
+
A as useFacebook,
|
|
205
|
+
M as useInstagram,
|
|
206
|
+
D as useTiktok,
|
|
207
|
+
F as useVimeo,
|
|
208
|
+
U as useYoutube
|
|
244
209
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pieda/video-dl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/video-dl.cjs",
|
|
7
7
|
"module": "dist/video-dl.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"axios": "^1.10.0",
|
|
41
41
|
"puppeteer": "^22.13.1",
|
|
42
|
-
"uuid": "^
|
|
42
|
+
"uuid": "^10.0.0",
|
|
43
43
|
"youtubei.js": "^14.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|