-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathytdl
More file actions
executable file
·41 lines (37 loc) · 1.92 KB
/
ytdl
File metadata and controls
executable file
·41 lines (37 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: ytdl
# Created: Sunday, 2022/04/03 - 16:49:39
# Author.: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Tuesday, 2025/04/08 - 12:05:12
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.0.4.98
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# ############################################################################
# HISTORY:
#
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
# shellcheck disable=SC1090,SC2154
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
source "$xSHELL_INIT"
use args ytdl.lib
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
xrequirements "yt-dlp|youtube-dl cut sed"
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
xarg --id -V,--video --var flag:v,url+r --desc "download video from YouTube url"
xarg --id -a,--audio --var flag:a,url+r --desc "download audio from YouTube url"
xarg --id -e,--extract --var flag:e,filename+r --desc "extract audio from a local video file"
xarg --header "download a video/audio from a given url on YouTube"
xrun --xreject-unknow --xrequire-one --xversionrc --xcolors "$@"
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~
case "$flag" in
v) runCMD video "$url" ;;
a) runCMD audio "$url" ;;
e) ytExtract "$url" ;;
esac