Skip to content

Commit

Permalink
Update dependencies and add preload
Browse files Browse the repository at this point in the history
  • Loading branch information
sudospaes committed Aug 7, 2024
1 parent 1499342 commit f7fdc3a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 37 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@distube/ytdl-core": "^4.13.7",
"@distube/ytdl-core": "^4.14.3",
"chalk": "^4.1.2",
"commander": "^12.1.0",
"easy-table": "^1.2.0",
Expand Down
34 changes: 4 additions & 30 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from "./cli/functions";
import { Wrong } from "./cli/logs";

process.env.YTDL_NO_UPDATE = "1";
import "./preload";

const app = new Command();

app
Expand All @@ -30,49 +31,22 @@ app

app
.command("get")
.description("show youtube link details for you :3")
.description("show youtube link details")
.argument("<link>", "youtube link")
.addOption(new Option("-h, --help").hideHelp())
.addHelpText(
"after",
`${chalk.green("\nExamples:")}
${chalk.yellow("get")} youtube_link`
)
.action(async (link, options) => {
checkLink(link);
linkInfomation(link);
});

app
.command("down")
.description("download youtube videos/audios for you :P")
.description("download youtube video/audio")
.argument("<link>", "youtube link")
.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("--mp3", "this flag is only used together with -a flag")
.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) => {
checkLink(link);
let isVideoTagValid,
Expand Down
1 change: 1 addition & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.YTDL_NO_UPDATE = "1";

0 comments on commit f7fdc3a

Please sign in to comment.