mov-cli / mov-cli

Watch everything from your terminal.
https://mov-cli.github.io/
MIT License
411 stars 36 forks source link

feat: add custom scraper args to cli #255 #249 #261

Closed THEGOLDENPRO closed 1 month ago

THEGOLDENPRO commented 1 month ago

This is the pull request that will break plugins that have not performed the changes stated at #255. I'll hold back on this pull request for a little while.

This feature allows the passing of arguments directly to the scraper. Like example let's say I want to stream the song "82 99 F.M" from "macross 82-99" on youtube, but I want audio only; thanks to scraper args we can actually tell the scraper that we would like to scrape the audio stream instead of the video stream like so:

mov-cli -c 1 -s youtube 82 99 F.M macross 82-99 -- --audio

-- is the magic here, -- tells the cli that the arguments after it should be passed directly to the scraper. You can take advantage of this in the Scraper.scrape() method like so:

def scrape(self, metadata: Metadata, episode: Optional[utils.EpisodeSelector] = None, **kwargs: Dict[str, bool]) -> Series | Movie:
    audio_only: bool = kwargs.get("audio", False)

    print(f"Audio mode is '{audio_only}'!")
THEGOLDENPRO commented 1 month ago

This has been merged into v4.2.0 branch. https://github.com/mov-cli/mov-cli/commit/2e562220726a8b121f66ff8fdd4a61bccb7bfd5b