- **`cfg.py:`** Is a script that demonstrates the full functionality of the bot. It is the production configuration for [Mirai Nikki Bot](https://yandere.cc/MiraiNikkiBot). This config will show you how to skip certain segments of a video file (such as the OP and ED of an anime) as well as mark nsfw scenes as sensitive.
- **`cfg_netoge.py:`** Is much simpler. It is the production configuration for [Netoge Bot](https://yandere.cc/NetogeBot). It also skips the OP and ED of the anime, but there are no nsfw scenes.
To generate screenshots, the bot will call shell scripts located in the `src/` directory and specified in the `render_script` value in the `setup_episode()` function. By default the below scripts are included:
The bot will call these scripts with positional arguments for the input path, output path, and frame position (in seconds). Please modify these scripts to suit your preferences.
This is the main configuration setting for the bot.
**`visibility:`** The visibility of the post ('public', 'unlisted', 'private', or 'direct').
**`feature_set:`** The feature set of the instance you are connecting to ('mainline', 'fedibird', or 'pleroma'). **This bot has only been tested with 'pleroma'.**
**`uploads_per_post:`** The number of times the bot should post after `sleep_seconds`
**`max_errors:`** The max consecutive posting errors that should occur before the bot gives up and exits. This usually indicates a temporary problem with the remote server, however if the bot repeatedly fails, and the server is up, it probably means the image is too large to upload. Try reducing the `max_size` variable if this happens. Your image may also be in a format that the remote server rejects, in which case the post should be added to the master blacklist.
**`retry_seconds:`** The time to wait between post attempts (in seconds).
**`content_type:`** The content type of the post ('text/plain' (default), 'text/markdown', 'text/html', 'text/bbcode'). **This bot has only been tested with `'text/plain'` and `'text/markdown'`**.
**`content_newline:`** The newline character or string. This will be inserted between each line in the message. If `content_type` is `'text/plain'`, this value should be `'\n'`. If `content_type` is `'text/markdown'` you may need to experiment. On some instances the default `'\n'` works, on others you may need to change this to `'<br/>'`.
**`post_image_link:`** If set to `True` this will insert a direct media link at the end of the message for each media file uploaded. If `content_type` is `'text\markdown'` it will make the link actionable, otherwise it will simply be a plain text html link. Some instances add this link automatically, in which case this should be set to `False`. See `content_newline` and `content_type` to correctly configure actionable links.
**`debug:`** Set this to true for testing. This will prevent Mirai Nikki Bot from logging into the mastodon instance and asking for your encryption password (meaning that nothing will actually get posted to your account, but it will still do everything else).
**`long_date_format:`** Time and date format. `settings_encrypt["reminder"]` Should be in this format. CreatePleromaApp will use this value if available.
**`datetime:`** A custom time to be printed by the bot if ${datetime} substitution is used in the profile output path.
## settings_post
Configure Mirai Nikki Bot profiles. Use the `setup_profile()` function to set profiles up in a single line.
# Setting Up Profiles
Each profile in `settings_post` contains a dictionary with the below keywords. Use the `setup_episode()` function with the same parameter names to setup posts in a single line.
Below is an explanation of each keyword:
* **`profile_name:`** String value. The name of the profile. This is mainly used to help you identify what profile is being applied to posts. This information is printed by the bot, but is otherwise unused.
* **`path:`** The input path of the video file.
* **`frames:`** The final frame of the video file (in seconds).
* **`skip:`** A tuple of tuples of time ranges to skip.
* **`output_name:`** The output path of the string. This string can include the following shell-like variables that the bot will automatically substitute:
* **`${frame}:`** The selected frame in seconds.
* **`${profile_name}:`** The name of the profile.
* **`${datetime}:`** The date and time of the selection formatted in the settings_time["datetime"] variable
* **`message:`** String value. The body of the post when a *safe* frame is selected.
* **`message_nsfw:`** String value. The body of the post when a *nsfw* frame is selected.