pystardust / ani-cli

A cli tool to browse and play anime
GNU General Public License v3.0
8.04k stars 554 forks source link

Stream Quality Choice option not working #630

Closed relejek closed 2 years ago

relejek commented 2 years ago

Metadata (please complete the following information) Version: 2.0.0 OS: arch Linux Shell: bash Anime: one piece sub ep 1 (test)

Describe the bug Quality choice is not working it is defaulting to best quality only. lower quality option are not working like 360p, 480p, or 720p

snippet of shell debug mode below:

++ video_links=https://www09.gogocdn.stream/videos/hls/7GSePHJBNhkjBA0-FPLEyw/1649331807/3518/0b594d900f47daabc194844092384914/ep.1.1647057721.m3u8
++ case $quality in
+++ printf %s https://www09.gogocdn.stream/videos/hls/7GSePHJBNhkjBA0-FPLEyw/1649331807/3518/0b594d900f47daabc194844092384914/ep.1.1647057721.m3u8
+++ grep -i 360p
+++ head -n 1
++ video_link=
++ '[' -z '' ']'
++ err 'Current video quality is not available (defaulting to best quality)'
++ printf '\033[1;31m%s\033[0m\n' 'Current video quality is not available (defaulting to best quality)'
Current video quality is not available (defaulting to best quality)
++ quality=best
+++ printf %s https://www09.gogocdn.stream/videos/hls/7GSePHJBNhkjBA0-FPLEyw/1649331807/3518/0b594d900f47daabc194844092384914/ep.1.1647057721.m3u8

Steps To Reproduce

  1. Run ani-cli -q 360 -a 1 one piece

OR

  1. Run ani-cli -q 720 -a 1 one piece

OR

  1. Run ani-cli -q 480 -a 1 one piece

Expected behaviour Should get video stream in preferred quality if actually available.

relejek commented 2 years ago

test stream url: one piece ep1

$ mpv https://www09.gogocdn.stream/videos/hls/dn6O1mX9OBSxK1Kvv0P2AA/1649363735/3518/0b594d900f47daabc194844092384914/ep.1.1647057721.m3u8 --vid=2 '--referrer=https://goload.pro/streaming.php?id=MzUxOA==&title=One+Piece&typesub=SUB&sub=eyJlbiI6bnVsbCwiZXMiOm51bGx9&cover=aW1hZ2VzL2FuaW1lL09uZS1waWVjZS5qcGc=' '--force-media-title=One Piece Episode 1'
Resuming playback. This behavior can be disabled with --no-resume-playback.
     Video --vid=1 (h264 640x360 23.976fps) (196 kbps)
 (+) Video --vid=2 (h264 854x480 23.976fps) (314 kbps)
     Video --vid=3 (h264 1280x720 23.976fps) (691 kbps)
     Video --vid=4 (h264 1920x1080 23.976fps) (1628 kbps)
     Audio --aid=1 (aac 2ch 44100Hz) (196 kbps)
     Audio --aid=2 (aac 2ch 44100Hz) (314 kbps)
     Audio --aid=3 (aac 2ch 44100Hz) (691 kbps)
 (+) Audio --aid=4 (aac 2ch 44100Hz) (1628 kbps)

the stream provides for us to choose from the quality, but after the mpv player starts. i don't know how to change quality while the player is active. I couldn't find any method to get this format listing and change --vid= .

help.