update yt
This commit is contained in:
parent
4a26f5ef9f
commit
d821090612
10
scripts/yt
10
scripts/yt
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[ -z "${YT_DATFILE}" ] && YT_DATFILE="${HOME}/.local/share/ytdat"
|
[ -z "${YT_DATFILE}" ] && YT_DATFILE="${HOME}/.local/share/ytdat"
|
||||||
[ -z "${YT_CACHEDIR}" ] && YT_CACHEDIR="${HOME}/.local/share/ytcache"
|
[ -z "${YT_CACHEDIR}" ] && YT_CACHEDIR="${HOME}/.local/share/ytcache"
|
||||||
[ -z "${YT_TORIFY}" ] && YT_TORIFY="torify"
|
[ -z "${YT_TORIFY}" ] && YT_TORIFY=""
|
||||||
ver=0.1
|
ver=0.1
|
||||||
|
|
||||||
info () {
|
info () {
|
||||||
|
@ -14,6 +14,7 @@ yt - youtube tool
|
||||||
=> [d]el [id] - Remove a channel from the list
|
=> [d]el [id] - Remove a channel from the list
|
||||||
=> [h]elp - Show this help
|
=> [h]elp - Show this help
|
||||||
=> [i]d [url] - Show internal channel id
|
=> [i]d [url] - Show internal channel id
|
||||||
|
=> [c]lear - Clear cache
|
||||||
|
|
||||||
List file: export YT_DATFILE=<your file here>
|
List file: export YT_DATFILE=<your file here>
|
||||||
Cache directory: export YT_CACHEDIR=<your dir here>
|
Cache directory: export YT_CACHEDIR=<your dir here>
|
||||||
|
@ -63,6 +64,9 @@ del () { # $1: line number of channel id
|
||||||
cache
|
cache
|
||||||
sed -i "${1}d" ${YT_DATFILE}
|
sed -i "${1}d" ${YT_DATFILE}
|
||||||
}
|
}
|
||||||
|
cclear () {
|
||||||
|
rm -r ${YT_CACHEDIR}
|
||||||
|
}
|
||||||
case $1 in
|
case $1 in
|
||||||
"s"*)
|
"s"*)
|
||||||
sync
|
sync
|
||||||
|
@ -87,6 +91,10 @@ case $1 in
|
||||||
err "two args required"
|
err "two args required"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
"c"*)
|
||||||
|
cclear
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
display
|
display
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue