justfoolingaround / animdl

A highly efficient, fast, powerful and light-weight anime downloader and streamer for your favorite anime.
GNU General Public License v3.0
1.33k stars 109 forks source link

Inconsistent prompt - search result and stream #213

Closed RaitaroH closed 1 year ago

RaitaroH commented 1 year ago

Describe the bug

I think is best to offer the output. If I use the query like so (also works from config file):

$ animdl stream 'Bungou Stray Dogs' -q '1080/720/480[subtitle]/best' -r 1

I get the old output style when choosing a stream for number 7 (the prompts.py: bit)

Hey, buddy.
   It is 06:52 PM on a beautiful Wednesday!
Waiting for you to select a 'search result'.
   1. Bungou Stray Dogs / https://gogoanime.cm/category/bungou-stray-dogs
   2. Bungou Stray Dogs Wan! / https://gogoanime.cm/category/bungou-stray-dogs-wan
   3. Bungou Stray Dogs (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-dub
   4. Bungou Stray Dogs Wan! (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-wan-dub
   5. Bungou Stray Dogs 3rd Season / https://gogoanime.cm/category/bungou-stray-dogs-3rd-season
   6. Bungou Stray Dogs 2nd Season / https://gogoanime.cm/category/bungou-stray-dogs-2nd-season
   7. Bungou Stray Dogs 4th Season / https://gogoanime.cm/category/bungou-stray-dogs-4th-season
   8. Bungou Stray Dogs: Dead Apple / https://gogoanime.cm/category/bungou-stray-dogs-dead-apple
   9. Bungou Stray Dogs: Hitori Ayumu / https://gogoanime.cm/category/bungou-stray-dogs-hitori-ayumu
   10. Bungou Stray Dogs 2nd Season (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-2nd-season-dub
   11. Bungou Stray Dogs 3rd Season (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-3rd-season-dub
   12. Bungou Stray Dogs: Dead Apple (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-dead-apple-dub
   13. Bungou Stray Dogs: Hitori Ayumu (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-hitori-ayumu-dub
   Select the search result (automatically selects the top search result) [1/2/3/4/5/6/7/8/9/10/11/12/13]: 7
Scraping juicy streams from 'gogoanime'@https://gogoanime.cm/category/bungou-stray-dogs-4th-season
   Now streaming 'Bungou Stray Dogs 4th Season'
[prompts.py:184 - 2023-01-11 18:53:03,425 - streamer: INFO] Uncategorised
[prompts.py:186 - 2023-01-11 18:53:03,425 - streamer: INFO] None
[prompts.py:188 - 2023-01-11 18:53:03,425 - streamer: INFO] Hard Subtitles
[prompts.py:190 - 2023-01-11 18:53:03,426 - streamer: INFO] 01 / 222981899017.m3u8 / cache.387e6278d8e06083d813358762e0ac63.com
[prompts.py:190 - 2023-01-11 18:53:03,426 - streamer: INFO] 02 / bungou-stray-dogs-4th-season-episode-1.original.m3u8 / wwwx11.gofcdn.com
Select above, using the stream index [1]: ^CAborted!

Also note that, stream selection does not get routed through fzf. The "Uncategorised", "None" and "Hard Subtitles" are not really choices, 01 and 02 are. Maybe these shouldn't be printed.

If I just use the typical best then I don't get any prompt:

animdl stream 'Bungou Stray Dogs' -q 'best[subtitle]/best' -r 1
Welcome, buddy.
   It is 06:53 PM on a beautiful Wednesday!
Waiting for you to select a 'search result'.
   1. Bungou Stray Dogs / https://gogoanime.cm/category/bungou-stray-dogs
   2. Bungou Stray Dogs Wan! / https://gogoanime.cm/category/bungou-stray-dogs-wan
   3. Bungou Stray Dogs (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-dub
   4. Bungou Stray Dogs Wan! (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-wan-dub
   5. Bungou Stray Dogs 3rd Season / https://gogoanime.cm/category/bungou-stray-dogs-3rd-season
   6. Bungou Stray Dogs 2nd Season / https://gogoanime.cm/category/bungou-stray-dogs-2nd-season
   7. Bungou Stray Dogs 4th Season / https://gogoanime.cm/category/bungou-stray-dogs-4th-season
   8. Bungou Stray Dogs: Dead Apple / https://gogoanime.cm/category/bungou-stray-dogs-dead-apple
   9. Bungou Stray Dogs: Hitori Ayumu / https://gogoanime.cm/category/bungou-stray-dogs-hitori-ayumu
   10. Bungou Stray Dogs 2nd Season (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-2nd-season-dub
   11. Bungou Stray Dogs 3rd Season (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-3rd-season-dub
   12. Bungou Stray Dogs: Dead Apple (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-dead-apple-dub
   13. Bungou Stray Dogs: Hitori Ayumu (Dub) / https://gogoanime.cm/category/bungou-stray-dogs-hitori-ayumu-dub
   Select the search result (automatically selects the top search result) [1/2/3/4/5/6/7/8/9/10/11/12/13]: 7
Scraping juicy streams from 'gogoanime'@https://gogoanime.cm/category/bungou-stray-dogs-4th-season
   Now streaming 'Bungou Stray Dogs 4th Season'
      Currently playing: 'Episode 1'. 0 episodes in queue.
         This stream may be share-able [embeddable and playable as a single URL] (please note that subtitles, chapters and titles won't be embedded).
         Share-ables: embed, direct url
Saving state.

Did the error occur in between an active task (download / stream / grab)? As you can see this happens before any stream. As mentioned the stream selection does not call fzf which I do think is an issue; the prompt.py may not be an issue.

Additional information

Furthermore, in this example the URLs from $ animdl grab 'Bungou Stray Dogs 4th Season' have no quality attached, as such the query I specified just doesn't know what to pick, so it asks me. This can be a problem with "best" because, what if the first url is 360p and second is 1080p but both have null? Perhaps animdl should not auto-pick in this case but instead ask?

{"episode": 2, "streams": [{"stream_url": "https://cache.387e6278d8e06083d813358762e0ac63.com/222981896638.m3u8", "quality": null}, {"stream_url": "https://www09.gofcdn.com/videos/hls/3jCA5SiJyezWg2lIkglnrA/1673470933/197539/7765f717391e12d867d790ce73a3adb0/ep.2.1673454365.m3u8", "quality": null}]}
justfoolingaround commented 1 year ago

Made changes as required as of 1.7.0.