Skip to content

Commit

Permalink
fix downloading #33
Browse files Browse the repository at this point in the history
  • Loading branch information
RaitaroH committed Apr 2, 2021
1 parent 7752e36 commit 5222418
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adl
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,21 @@ animedl() { #{{{

if [ "$local" == "0" ]; then
#-c 0 used to mean nothing, so instead pass skip-download which will mean nothing
[[ -z "$yes" ]] && choice="--skip-download" || choice="-c 1"
choice_arg() { [[ -z "$yes" ]] && echo "" || echo "-c 1" ;}

# I can't seem to get anime dl to work unless I use a function like this
player_arg="$1"
down_arg() { [[ "$download" == "0" ]] && echo "--play $player_arg" || echo "" ;}

if [[ "$4" != "" ]]; then
{ out=$(anime dl $(down_arg) "$2" --episodes "$3":"$4" "$choice" | tee >(cat - >&5)); } 5>&1
{ out=$(anime dl $(down_arg) "$2" --episodes "$3":"$4" $(choice_arg) | tee >(cat - >&5)); } 5>&1
return 1
else
if [[ "$3" != "" ]]; then
{ out=$(anime dl $(down_arg) "$2" --episodes "$3" "$choice" | tee >(cat - >&5)); } 5>&1
{ out=$(anime dl $(down_arg) "$2" --episodes "$3" $(choice_arg) | tee >(cat - >&5)); } 5>&1
return 1
else
{ out=$(anime dl $(down_arg) "$2" "$choice" | tee >(cat - >&5)); } 5>&1
{ out=$(anime dl $(down_arg) "$2" $(choice_arg) | tee >(cat - >&5)); } 5>&1
return 1
fi
fi
Expand Down

0 comments on commit 5222418

Please sign in to comment.