Skip to content

Configuration

Ananas edited this page Jun 20, 2024 · 52 revisions

Introduction

For persistent configuration, we have a config.toml file located at the following locations:

Note

Let us know if these paths are incorrect and if we should change them.

Also note: MacOS is not completely supported in mov-cli yet.

OS Config Path
iOS ~/.config/mov-cli/config.toml
Linux ~/.config/mov-cli/config.toml
Android ~/.config/mov-cli/config.toml
Windows %LocalAppData%\mov-cli\config.toml
MacOS ~/Library/Application Support/mov-cli/config.toml

Although you actually don't need to know this to access it. We have a command for that. ✨

mov-cli -e

or mov-cli --edit


TOML Keys & CLI Options

Note

CLI options will take priority over the toml config.

Version

As the config file might change in the future we added a version key in the case we perform large breaking changes.

[mov-cli]
version = 1

Player

This is where you can specify to mov-cli which player it should stream media to. Custom players are now supported, so you can set any player under the player key and it will be called like so: {player} {url}. The default player is mpv although there's first-party support for some other players too.

Default Options
mpv "mpv", "vlc", "syncplay", "iina", Anything
[mov-cli]
player = "mpv"

CLI Options:

mov-cli chuunibyou demo take on me --player vlc

or

mov-cli -p vlc chuunibyou demo take on me

Player Args

Warning

This is only available in v4.4!

Since mov-cli v4.4 we've added the ability to override and set your own player arguments.

Default Options
[] Anything
[mov-cli.player]
args = []

For example let's say I want mpv to stream my content directly to the terminal using the kitty protocol. This is how we would achieve that:

[mov-cli.player]
binary = "mpv"
args = [
    "--vo=kitty"
]
args_override = true # This will remove the predefined args that mov-cli sets completely override them with your args.

Debug

With the debug key set mov-cli will log a lot more details to the console. This is very useful when reporting bugs.

Default Options
false "true", "false"
[mov-cli]
debug = false

CLI Options:

mov-cli --debug

Debug Player

Warning

This is only available in v4.4!

In mov-cli enabling debug mode still silents the player's output, to avoid this an extra config key under [mov-cli.debug] been created.

Default Options
false "true", "false"
[mov-cli.debug]
player = false

As debug is no longer an available key, to enable normal debugging alongside player debugging too you can use the above in conjuction with the global key like so:

[mov-cli.debug]
global = true
player = true

Parser

Force set's the parser beautifulsoup should use. Defaults to lxml if it's available as it's faster, otherwise it defaults to html.parser.

Default Options
lxml "lxml", "html.parser"
[mov-cli]
parser = "lxml"

Editor

Specifies to mov-cli the editor the config file should be opened in with mov-cli -e / mov-cli --edit. Defaults to the platform specific editor.

OS Default Editor
iOS vi
Linux nano
Android nano
Windows notepad.exe
MacOS nano
[mov-cli]
editor = "nano"

Skip Update Checker

This section allows you to specify whether the update checker should be skipped or not.

Default Options
false "false", "true"
[mov-cli]
skip_update_checker = false

Hide IP

Warning

This is only available in v4.4!

This section allows you to specify whether mov-cli should try to hide IP's during debug logs.

Note

Third-party plugins can still log whatever they want however.

Default Options
true "false", "true"
[mov-cli]
hide_ip = true

Fzf

This section allows you to specify whether mov-cli should utilize fzf for the media selection interface. By default, mov-cli will use fzf for the media selector if it's available. Which can be overwritten if set to false.

Default Options
true "false", "true"
[mov-cli.ui]
fzf = true

Limit

With the limit key set to a specific number, mov-cli will limit the number of results returned.

Default Options
20 Anything
[mov-cli.ui]
limit = 20

CLI Options:

mov-cli --limit 10

Preview

Warning

This is only available in v4.4!

Note

Available only on Linux.

This section allows you to toggle whether fzf's preview (image preview, etc) should be enabled.

Requirement: chafa or kitty.

Kooha-2024-06-11-21-47-32.mp4
Default Options
false "true", "false"
[mov-cli.ui]
preview = false

CLI Options:

mov-cli --preview

Watch Options

This section allows you to specify whether you want watch options to be shown.

Default Options
true "true", "false"
[mov-cli.ui]
watch_options = true

Display Quality

Warning

This is only available in v4.4!

This section allows you to specify whether mov-cli should print the quality.

Requirement: ffprobe

Default Options
false "true", "false"
[mov-cli.ui]
display_quality = false

Plugins

This section allows you to specify the installed plugins for mov-cli.

List your plugins under the [mov-cli.plugins] by providing the plugin namespace and its corresponding package name.

[mov-cli.plugins] # Example: namespace = "package-name"
test = "mov-cli-test"

Scrapers

Warning

Partially available only in v4.4!

A lot can be accomplished with the scrapers key, including:

Default Scraper

You can specify a default scraper to be automatically selected by utilizing the default key under scrapers like the example below.

Default Options
None Anything
[mov-cli.scrapers]
default = "youtube"

Now calling mov-cli with a query but without the scraper cli arg, will search with our chosen scraper by default:

mov-cli {query}

Namespace Overriding

Warning

This is only available in v4.4 alpha 4!

Starting from mov-cli v4.4 you are now able to override scraper namespaces and create new ones with full freedom.

Example #1:

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

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

Here's a better example, let's say we want a youtube scraper for streaming music audio only; using scraper overrides you can theoretically create another scraper with the custom scraper options to stream audio only and in the meantime get rid of pesky shorts in the search.

Example #2:

[mov-cli.scrapers]
yt-music = {namespace = "youtube.DEFAULT", options.audio = true, options.shorts = false }
mov-cli -s yt-music 82 99 F.M macross 82-99

This format also works and does the exact same as the previous toml config:

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

options.audio = true
options.shorts = false

HTTP Headers

Force set custom HTTP headers for mov-cli to use. By default, mov-cli will use its own predefined set of headers. However, you can override these defaults.

Default Options
{ User-Agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0" } Any HTTP Header

Warning

Don't mess with it if you are not sure what you are doing! Editing this incorrectly will cause issues.

[mov-cli.http]
headers = { User-Agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0" }

HTTP Timeout

Warning

This is only available in v4.4!

Experiencing timeout issues? With this config key you may adjust the default http timeout (in seconds).

Default Options
15 Any Number

Warning

Messing with this config can cause instability, besure to know what you are doing is correct.

[mov-cli.http]
timeout = 15

Quality

Warning

This is only available in v4.4!

Specify a preferred resolution for media. mov-cli will prioritize media streams of that specified resolution.

Note

This setting is applicable only if the scraper supports it.

Default Options
auto "auto", "sd", "hd", "fhd", "qhd", "uhd", ...
[mov-cli]
quality = "auto"

List of quality formats just for reference:

Format Pixels (in height)
SD 480p
HD 720p
FHD 1080p
QHD (2K) 1440p
UHD (4K) 2160p

For resolution, you set it via the resolution key like so:

[mov-cli.quality]
resolution = 720

Downloads

Warning

Some of this section is only available in v4.4!

Specify a download location where media will be saved and if yt-dlp should be used when using -d flag

Note

Please use forward slashes (/) instead of backslashes (\) in the file path.

[mov-cli.downloads]
save_path = "~/Downloads"
yt_dlp = true

Subtitles

Specify a language for which the scraper should try to get subtitles.

See this page for your language code: List of ISO 639 language codes

[mov-cli.subtitles]
language = "en"

Environment Variables

Warning

This is only available in v4.4!

Environment variables are used when plugins require settings such as login credentials. For example, the mov-cli-jellyplex plugin will utilize this.

Do not share the .env file with anyone.

To edit your .env file, use the following command:

mov-cli -e .env

Here are some examples of how environment variables should be used:

SECRET_INFORMATION = "you should keep this a secret"
USERNAME = "nyanuser2"
PASSWORD = "i-L@vE-Cats-8443"

Plugins should state in their readme whether they require you to add an environment variable.