animdl icon indicating copy to clipboard operation
animdl copied to clipboard

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

Open LQR471814 opened this issue 11 months ago • 0 comments

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": [...]}
...

LQR471814 avatar Jul 18 '23 16:07 LQR471814