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.32k stars 109 forks source link

Feat: Add flags anime-url and episode-count to grab #280

Open LQR471814 opened 1 year ago

LQR471814 commented 1 year ago

This PR adds the following flags to the grab command.

-u, --anime-url TEXT      Use the URL for a specific anime, overrides query.
-e, --episode-list        Only return a list of episode numbers for the given anime.

They were added to help external programs reduce overhead in using animdl's features. Particularly in these two use cases.

  1. Not needing to search twice, one can simply pipe in the url returned by animdl search -j ....
  2. Being able to know the available episodes of a given anime without running a full grab.
$ animdl grab --episode-list "allanime:bocchi the rock"

Welcome, lqr471814.
   It is 09:09 AM on a beautiful Tuesday!
The content is outputted to stdout while these messages are outputted to stderr.
Waiting for you to select a 'search result'.
{"episodes": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}
$ animdl grab --anime-url https://allanime.to/anime/5FYQwxEPq4YdppRKK "bocchi the rock"

Hey, lqr471814.
   It is 09:12 AM on a beautiful Tuesday!
The content is outputted to stdout while these messages are outputted to stderr.
{"episode": 1, "streams": [...]}
{"episode": 2, "streams": [...]}
...