Open toomyzoom opened 2 years ago
Oof, fixed as of
1.6.21
. Thank you for reporting this issue.Details:
Cause of error: Inverted logical operator. Expected outcome: No banner in log level higher than 20. Unfixed outcome; No banner in log level lesser than 20. Fixed version: 1.6.21
I think you mean this reply for #168
I modified grab.py, animdl_grab
function
def animdl_grab(query, index, log_level, **kwargs):
r = kwargs.get("range")
logger = logging.getLogger("grabber")
anime, provider = helpers.process_query(
client, query, logger, auto_index=index, provider=DEFAULT_PROVIDER
)
if not anime:
return
logger.name = "{}/{}".format(provider, logger.name)
logger.info("Initializing grabbing session.")
for stream_url_caller, episode in providers.get_appropriate(
client, anime.get("anime_url"), check=r
):
stream_url = list(helpers.ensure_extraction(client, stream_url_caller))
click.echo(json.dumps({"title": anime.get("name") + ' ' + str(episode), "episode": episode, "streams": stream_url}))
logger.info("Grabbing session complete.")
This change is at line:
< click.echo(json.dumps({"episode": episode, "streams": stream_url}))
---
> click.echo(json.dumps({"title": anime.get("name") + ' ' + str(episode), "episode": episode, "streams": stream_url}))
This will show the title with episode number just like how you did it in stream.py in b1b74a98645174dbacf84d36b43ff6b056745094
From maintainers: Both labels have been handed to this issue, remove the inapplicable one. Your title should answer at least 3 of 5W1H questions for fastest responses.
Is your feature request related to a problem? Please describe.
So currently, animdl is opening/closing instance for every video when using
stream
command instart_streaming_mpv()
function. This is a problem for me because:input-ipc-server
switch to create a named pipe in order to control/add file to the current instance without closing it. Opening and closing for every video are not efficient while all videos can just be queued to the current playlist.So I tried to use
grab
and parsing the json output to feed it to my mpv instance through ipc socket. This approach was acceptable but the json only contains theepisode
andstream_url
fields. I need something to get the series name likeanimdl search --json <name>
output to set the title correctly like how it was done instart_streaming_mpv()
I need this because I use something similar to #86.
There are currently 2 approaches that I consider appropriate:
Describe the solution you'd like
stream
command: currently, these options are used: force-window, http-header-fields, title, force-media-title, sub-file. They can be used the same way with a minor tweak usingloadfile
command for mpv https://mpv.io/manual/master/#command-interface as long as there is a way to specify mpv instance named pipe. The json probably something looks like this as the manual link described:{"command":["loadfile", <url>, <flags>, [<options>]]}
Describe alternatives you've considered
grab
command: there should be series name in the json output besideepisode
andstream_url
or a way to toggle it by some flag.Additional context
Modifying the
grab
command to output the series name is likely less work than thestream
command suggestion.