Skip to content

Commit

Permalink
fix: obsucre vlc audio problem (#674)
Browse files Browse the repository at this point in the history
* feat: m3u8 quality with a different method, #665 fix

* QA: trimmed `get_video_quality`
QA: function for selecting the *n*th line

* Made aria2c a fix dependency

* chore: shellcheck

* revert back to index method

* shellcheck compliance

* made 1080p force 1080p and best same as default

* shellcheck compliance

* reverted misleading line in README.md

Co-authored-by: RaynardGerraldo <RaynardGerraldo@users.noreply.github.com>
Co-authored-by: Derisis13 <email.felhasznalasra@gmail.com>
  • Loading branch information
3 people authored Apr 21, 2022
1 parent 01574f9 commit 9de3424
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ani-cli
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,25 @@ get_video_quality_mp4() {
printf '%s' "$video_url"
}

get_video_quality_m3u8() {
get_video_quality_m3u8() {
m3u8_links=$(curl -s --referer "$dpage_link" "$video_url" | sed 's/#.*$//' | sed '/^[[:space:]]*$/d')
links_count=$(printf '%s' "$m3u8_links" | wc -w)
case $quality in
worst|360)
idx=2 ;;
480)
idx=3 ;;
720)
idx=4 ;;
1080|best)
idx=5 ;;
*)
idx=1 ;;
1080)
idx=5 ;;
best|*)
idx="$links_count" ;;
esac
if [ "$idx" -lt 1 ] || [ "$idx" -gt "$links_count" ];then
err "Current video quality is not available (defaulting to best quality)"
idx="$links_count"
fi
printf '%s' "$video_url" | grep -qE "gogocdn.*m3u.*" && idx=$((idx-1))
}

Expand Down

0 comments on commit 9de3424

Please sign in to comment.