diff --git a/ani-cli b/ani-cli index 5a78ed6d2..fd0df972a 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="5.0.2" +version_number="5.0.3" # UI @@ -161,7 +161,7 @@ anidb_search() { [ "$curl_exe" = "curl" ] && die "Blocked by cloudflare. Try installing curl-impersonate" die "Blocked by cloudflare." fi - printf "%s" "$_page" | sed -nE 's|.*anime/([a-z0-9-]+-[0-9]+)".*alt="([^"]+)".*|\1\t\2|p' | sed -e "s|'|'|g" -e 's|"|"|g' + printf "%s" "$_page" | sed -nE 's|.*anime/([a-z0-9-]+-[0-9]+)".*alt="([^"]+)".*|\1\t\2|p' | sed -e "s|'|'|g" -e 's|"|"|g' -e "s|&|\&|g" } # extract mal_id and seasons metadata @@ -351,6 +351,7 @@ play() { _end=$(printf "%s" "$ep_no" | grep -Eo '(-1|[0-9]+(\.[0-9]+)?)$') [ "$_start" = "-1" ] && ep_no=$(printf "%s" "$ep_list" | tail -n 1) && unset _start [ -z "$_end" ] || [ "$_end" = "$_start" ] && unset _start _end + [ "$_start" = "0" ] && _start=$(printf "%s" "$ep_list" | head -n 1) [ "$_end" = "-1" ] && _end=$(printf "%s" "$ep_list" | tail -n 1) _line_count=$(printf "%s\n" "$ep_no" | wc -l | tr -d "[:space:]") if [ "$_line_count" != 1 ] || [ -n "$_start" ]; then diff --git a/ani-cli.1 b/ani-cli.1 index f6206efcf..450bdde01 100644 --- a/ani-cli.1 +++ b/ani-cli.1 @@ -17,7 +17,7 @@ This tool scrapes the site anidb. .SH OPTIONS .TP \fB\-e | --episode | -r | --range\fR \fI\,\/\fR -Specify the episode numbers to watch. If range is specified it should be quoted or separated by a non-numeric character (eg. -). +Specify the episode numbers to watch. If a range is specified, it should be quoted or separated by a non-numeric character (e.g. -). Use 0 for the first available episode and -1 for the last. .TP \fB\-c | --continue\fR Continue watching anime from history.