Update dependencies and add preload
This commit is contained in:
parent
14993423fe
commit
f7fdc3a2f5
4 changed files with 12 additions and 37 deletions
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -9,7 +9,7 @@
|
||||||
"version": "dev",
|
"version": "dev",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@distube/ytdl-core": "^4.13.7",
|
"@distube/ytdl-core": "^4.14.3",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
"easy-table": "^1.2.0",
|
"easy-table": "^1.2.0",
|
||||||
|
@ -114,9 +114,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@distube/ytdl-core": {
|
"node_modules/@distube/ytdl-core": {
|
||||||
"version": "4.13.7",
|
"version": "4.14.3",
|
||||||
"resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.13.7.tgz",
|
"resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.14.3.tgz",
|
||||||
"integrity": "sha512-xpovwZVPwQ0R4Mrwt/fhh1rqmBjiZ5qj30ck5kz+mQJ5XPzW9dUiTDz89qCxO3YvgbCAqaC5BNNnWiFC2uCV5Q==",
|
"integrity": "sha512-z6i5EVGEuKhuvuRNyIqafBSs5aRA28HssnWehCRhEtYrxeFgXImfmpKTjUusHYU5vQt1swSVPVb2JCd22P0CPA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"http-cookie-agent": "^6.0.5",
|
"http-cookie-agent": "^6.0.5",
|
||||||
|
@ -124,10 +124,10 @@
|
||||||
"miniget": "^4.2.3",
|
"miniget": "^4.2.3",
|
||||||
"sax": "^1.4.1",
|
"sax": "^1.4.1",
|
||||||
"tough-cookie": "^4.1.4",
|
"tough-cookie": "^4.1.4",
|
||||||
"undici": "^6.19.2"
|
"undici": "five"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=14.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/distubejs/ytdl-core?sponsor"
|
"url": "https://github.com/distubejs/ytdl-core?sponsor"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.4.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@distube/ytdl-core": "^4.13.7",
|
"@distube/ytdl-core": "^4.14.3",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
"easy-table": "^1.2.0",
|
"easy-table": "^1.2.0",
|
||||||
|
|
34
src/app.ts
34
src/app.ts
|
@ -12,7 +12,8 @@ import {
|
||||||
} from "./cli/functions";
|
} from "./cli/functions";
|
||||||
import { Wrong } from "./cli/logs";
|
import { Wrong } from "./cli/logs";
|
||||||
|
|
||||||
process.env.YTDL_NO_UPDATE = "1";
|
import "./preload";
|
||||||
|
|
||||||
const app = new Command();
|
const app = new Command();
|
||||||
|
|
||||||
app
|
app
|
||||||
|
@ -30,14 +31,9 @@ app
|
||||||
|
|
||||||
app
|
app
|
||||||
.command("get")
|
.command("get")
|
||||||
.description("show youtube link details for you :3")
|
.description("show youtube link details")
|
||||||
.argument("<link>", "youtube link")
|
.argument("<link>", "youtube link")
|
||||||
.addOption(new Option("-h, --help").hideHelp())
|
.addOption(new Option("-h, --help").hideHelp())
|
||||||
.addHelpText(
|
|
||||||
"after",
|
|
||||||
`${chalk.green("\nExamples:")}
|
|
||||||
${chalk.yellow("get")} youtube_link`
|
|
||||||
)
|
|
||||||
.action(async (link, options) => {
|
.action(async (link, options) => {
|
||||||
checkLink(link);
|
checkLink(link);
|
||||||
linkInfomation(link);
|
linkInfomation(link);
|
||||||
|
@ -45,34 +41,12 @@ app
|
||||||
|
|
||||||
app
|
app
|
||||||
.command("down")
|
.command("down")
|
||||||
.description("download youtube videos/audios for you :P")
|
.description("download youtube video/audio")
|
||||||
.argument("<link>", "youtube link")
|
.argument("<link>", "youtube link")
|
||||||
.option("-v <tag>", "pass the video tag you got from the get command")
|
.option("-v <tag>", "pass the video tag you got from the get command")
|
||||||
.option("-a <tag>", "pass the audio tag you got from the get command")
|
.option("-a <tag>", "pass the audio tag you got from the get command")
|
||||||
.option("--mp3", "this flag is only used together with -a flag")
|
.option("--mp3", "this flag is only used together with -a flag")
|
||||||
.addOption(new Option("-h, --help").hideHelp())
|
.addOption(new Option("-h, --help").hideHelp())
|
||||||
.addHelpText(
|
|
||||||
"after",
|
|
||||||
`${chalk.green("\nExamples:")}
|
|
||||||
standard download => ${chalk.yellow(
|
|
||||||
"down"
|
|
||||||
)} youtube_link -v tag_number -a tag_number
|
|
||||||
${chalk.hex("#DC84F3")(
|
|
||||||
`In standard download, I download video and audio separately and merging them with ffmpeg`
|
|
||||||
)}
|
|
||||||
${chalk.hex("#DC84F3")(
|
|
||||||
`If you don't provide video tag and audio tag, I'll download highest qualities of them`
|
|
||||||
)}\n
|
|
||||||
download only video => ${chalk.yellow("down")} youtube_link -v tag_number\n
|
|
||||||
download only audio => ${chalk.yellow(
|
|
||||||
"down"
|
|
||||||
)} youtube_link -a tag_number --mp3
|
|
||||||
${chalk.hex("#DC84F3")(
|
|
||||||
`If you use ${chalk.blue("--mp3")} with ${chalk.blue(
|
|
||||||
"-a"
|
|
||||||
)} flag, It will convert audio to mp3 with ffmpeg`
|
|
||||||
)}`
|
|
||||||
)
|
|
||||||
.action(async (link, options) => {
|
.action(async (link, options) => {
|
||||||
checkLink(link);
|
checkLink(link);
|
||||||
let isVideoTagValid,
|
let isVideoTagValid,
|
||||||
|
|
1
src/preload.ts
Normal file
1
src/preload.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
process.env.YTDL_NO_UPDATE = "1";
|
Loading…
Add table
Add a link
Reference in a new issue