mov-cli / mov-cli

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

[FEATURE] Scraper config and namespace overrides #291

Open EbanNox opened 1 month ago

EbanNox commented 1 month ago

@THEGOLDENPRO Hey Goldy o/ 👋, remeber u asked me to put this up on git issues then on discord.... whell here it is, config enchantment example:

EXAMPLE 1

config.toml:

[mov-cli.scrapers]
default = "wakanda.default"
vad = "wakanda.vadapav"
vid1 = "wakanda.vidsrcto"
vid2 = "wakanda.vidsrcme"
gogo = "jesus.anitaku"
9anime = "jesus.aniwave"

[mov-cli.plugins]
wakanda = "mov-cli-films"
jesus = "mov-cli-anime"

terminal usage from config:

'default':
> mov-cli spider man

'vadapav':
> mov-cli spider man -s vad

'vidsrcto':
> mov-cli spider man -s vid1

'vidsrcme':
> mov-cli godzilla -s vid2

'anitaku aka gogoanime':
> mov-cli overlord III -s gogo

'aniwave.to'
> mov-cli overlord III -s 9anime

EXAMPLE 2

config.toml:

[mov-cli.scrapers]
default = "films.default"
vada = "films.vadapav"
anime1 = "anime.anitaku"
anime2 = "anime.gogoanime"

terminal usage from config:

mov-cli -s anim1 "overlord III" // scrape anitaku for overlord III (anime.anitaku)
mov-cli -s anim2 "overlord III" // scrape gogoanime (anime.gogoanime)
etc
THEGOLDENPRO commented 1 month ago

Thanks for moving this to github, I think this is a really nice feature as it will also allow me to add per scraper configuration to the config file, like scraper options.

THEGOLDENPRO commented 3 weeks ago

This is how things look like currently:

[mov-cli.scrapers]
# default = "films"

yt = "youtube.DEFAULT"
yt-music = {namespace = "youtube.DEFAULT", options.audio = true, options.shorts = false }
yt-pytube = "youtube.pytube"

I can override scrapers just like you demonstrated and I can also pre define the scraper's custom options. For example say I want a seperate scraper that only streams audio from youtube and doesn't scrape for shorts, I can set that just like I set it above or also like this:

[mov-cli.scrapers.yt-audio]
namespace = "youtube.DEFAULT"

options.audio = true
options.shorts = false

If you just want another scraper then this is all you need:

[mov-cli.scrapers]
yt = "youtube.DEFAULT"

[mov-cli.plugins]
youtube = "mov-cli-youtube"
mov-cli -s yt nyan cat
THEGOLDENPRO commented 2 weeks ago

The scrapers config branch has now been merged into the v4.4 branch.

EbanNox commented 2 weeks ago

The scrapers config branch has now been merged into the v4.4 branch.

That is awesome , gonna jump in on testing this out, we'll done goldy. Excellent code structure as always

EbanNox commented 2 weeks ago

Just tested it... made my own namespases in scraper settings... but attempting to use the namespases in -s doesent seem to work...

[mov-cli.plugins]
tmdb = "mov-cli-films"
anime = "mov-cli-anime"
youtube = "mov-cli-youtube"
files = "mov-cli-files"

[mov-cli.scrapers]
vid1 = "tmdb.vidsrcto"
vid2 = "tmdb.vidsrcme"
vid3 = "tmdb.vadapav"
gogo = "anime.anitaku"
yt = "youtube.default"
file = "files.default"

Using mov-cli "gen V" -s vid1 and all the other namespases dosent work in current version from pypi

EbanNox commented 2 weeks ago

Nvm, had to switch to v4.4 branch and install that one.. all good

EbanNox commented 2 weeks ago

This is how things look like currently:

[mov-cli.scrapers]
# default = "films"

yt = "youtube.DEFAULT"
yt-music = {namespace = "youtube.DEFAULT", options.audio = true, options.shorts = false }
yt-pytube = "youtube.pytube"

I can override scrapers just like you demonstrated and I can also pre define the scraper's custom options. For example say I want a seperate scraper that only streams audio from youtube and doesn't scrape for shorts, I can set that just like I set it above or also like this:

[mov-cli.scrapers.yt-audio]
namespace = "youtube.DEFAULT"

options.audio = true
options.shorts = false

If you just want another scraper then this is all you need:

[mov-cli.scrapers]
yt = "youtube.DEFAULT"

[mov-cli.plugins]
youtube = "mov-cli-youtube"
mov-cli -s yt nyan cat

Btw, the "namespace" in youre config example, does it has to be that word? Or can ut be anything as the word namespace entails?

THEGOLDENPRO commented 2 weeks ago

Btw, the "namespace" in youre config example, does it has to be that word? Or can ut be anything as the word namespace entails?

in the second example yes "namespace" has to be "namespace".

THEGOLDENPRO commented 2 weeks ago

The scrapers config branch has now been merged into the v4.4 branch.

That is awesome , gonna jump in on testing this out, we'll done goldy. Excellent code structure as always

Thanks

EbanNox commented 2 weeks ago

The scrapers config branch has now been merged into the v4.4 branch.

That is awesome , gonna jump in on testing this out, we'll done goldy. Excellent code structure as always

Thanks

Well... somehow u r alredy able to use best practices in python coding... and that blows my minde

EbanNox commented 2 weeks ago

The scrapers config branch has now been merged into the v4.4 branch.

That is awesome , gonna jump in on testing this out, we'll done goldy. Excellent code structure as always

Thanks

Well... somehow u r alredy able to use the best practices in python coding... and that blows my minde