Skip to content

Commit df82ea2

Browse files
committed
updated ydlo function in bashrc.sh (to use mp4 as default)
1 parent c50f131 commit df82ea2

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tools/bashrc.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ alias cdp='cd -P .'
5050
alias clean='find . -name *.DS_Store -delete 2>/dev/null; find . -name Thumbs.db -delete 2>/dev/null'
5151
alias cls='clear && printf "\e[3J"'
5252
alias conv='iconv -f windows-1252 -t utf-8'
53+
alias dater='date +"%Y-%m-%d %H:%M:%S" -r'
54+
alias dated='date +"%Y-%m-%d %H:%M:%S" -d'
5355
alias dh='du -hs'
5456
alias dir='ls -al '
5557
alias dsclean='sudo find . -name Thumbs.db -delete -name *.DS_Store -type f -delete'
@@ -764,12 +766,13 @@ function ydlo() {
764766
local _earg_=""
765767
local _snum_=""
766768
local _bmkv_="--merge-output-format mkv"
769+
local _bmp3_="-f bestaudio -x --audio-format mp3 --audio-quality 0"
767770
local _bmp4_="-f bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4"
768771
local _enum_=""
769772
local _rvpl_=""
770773
# default sequence and extension for playlist
771774
local _extn_='-%(playlist_index)s.%(ext)s'
772-
local _ycmd_="${_tool_}"
775+
local _ycmd_="${_tool_} ${_bmp4_}"
773776
# echo "---args: $@"
774777
for p in "$@"; do
775778
echo "# $p"
@@ -783,8 +786,12 @@ function ydlo() {
783786
_enum_=$((${_snum_} + $p - 1)); fi; fi
784787
elif [[ "$p" =~ ^[/-]{1,2}mkv ]]; then
785788
_ycmd_="${_tool_} ${_bmkv_}"
789+
elif [[ "$p" =~ ^[/-]{1,2}mp3 ]]; then
790+
_ycmd_="${_tool_} ${_bmp3_}"
786791
elif [[ "$p" =~ ^[/-]{1,2}mp4 ]]; then
787792
_ycmd_="${_tool_} ${_bmp4_}"
793+
elif [[ "$p" =~ ^[/-]{1,2}best ]]; then
794+
_ycmd_="${_tool_}"
788795
elif [[ "$p" =~ ^[/-]{1,2}[rR] ]]; then
789796
_rvpl_="--playlist-reverse"
790797
else
@@ -796,7 +803,7 @@ function ydlo() {
796803
echo "┏━━━━━━━━┓"
797804
echo "┃ Syntax ┃"
798805
echo "┗━━━━━━━━┛"
799-
echo " ${FUNCNAME[0]} [-r] [-mkv|mp4] <http_url> [<start#> [<end#>]]"
806+
echo " ${FUNCNAME[0]} [-r] [-best|mkv|mp4] <youtube_url> [<start#> [<end#>]]"
800807
echo ""
801808
return
802809
fi

0 commit comments

Comments
 (0)