add menu and option for selecting provider to scrape (#14)

This commit is contained in:
Kyle Yasuda
2022-07-19 00:10:38 -07:00
committed by GitHub
parent df82425eae
commit 2bab68a887
4 changed files with 55 additions and 3 deletions

View File

@@ -446,7 +446,7 @@ parse_args() {
is_download=0
is_resume=0
is_autoplay=0
while getopts 'ad:Hsvq:cf:t:T:CQ:D:Sp:rR' OPT; do
while getopts 'ad:Hsvq:cf:t:T:CQ:D:Sp:P:rR' OPT; do
case "$OPT" in
a)
is_autoplay=1
@@ -531,6 +531,10 @@ parse_args() {
die "ERROR: $PLAYER_FN does not exist"
fi
;;
P)
select_provider="$OPTARG"
((select_provider < 1 || select_provider > 7)) && die "Invalid provider: $select_provider"
;;
*)
inf "Invalid option"
exit 1