Updated documentation

This commit is contained in:
Anon 2022-07-14 13:11:32 -07:00
parent 883a85ec7f
commit 791acc572a

View File

@ -1,52 +1,32 @@
# Readme
Yandere Lewd Bot is a customizable, no frills image-posting bot for Pleroma.
A live example can be viewed at [Neckbeard.xyz](https://neckbeard.xyz/YandereLewdBot).
A live example can be viewed at [GNU/Yandere](https://yandere.cc/YandereLewdBot).
Currently the bot will only run on Linux. I believe it should run on most distros but I have only tested it on Arch and Raspbian.
## Usage
```text
usage: main.py [--dry-run] [--debug] [-w WAIT] [-t TIME] [-d DATE] [-c CONFIG]
[-o] [-h]
A bot for posting on Mastodon
optional arguments:
--dry-run Will not login or post to Plemora
--debug Same as --dry-run
-w WAIT, --wait WAIT Wait before posting first image (seconds)
-t TIME, --time TIME Wait for time before posting first image
-d DATE, --date DATE Wait for date before posting first image
-c CONFIG, --config CONFIG
Set custom config file (Default: cfg)
-o, --output-hashes Output list of hashes
-h, --help Show this help message and exit
TIME %I:%M%p 03:58PM
DATE %m/%d/%Y 11/26/2021
```
## About
Yandere Lewd Bot is designed to be simple to understand (from a technical perspective) and easy to modify/extend. Yandere Lewd Bot relies on GNU formatted hash files to configure and organize posts (from the GNU coreutils package):
(ex. `26d00a6ee5ae8fa3d58ee44b32b8992f *./rsc/nsfw/image.jpg`)
The bot is still in development and can easily be crashed by writing a poorly configured `cfg.py` file, or messing with the hash files it uses to configure posts.
The bot is still in development and can easily be crashed by writing a poorly configured `cfg.py` file, or messing with the hash files it uses to configure posts. The bot may also crash with encoding errors for files with non-unicode filenames.
## Installing
To setup the python3 environment (for Arch Linux) run the following commands:
```
sudo pacman -Syu
sudo pacman -S --needed python git
git clone 'https://github.com/YandereLewdBot/YandereLewdBot.git'
git clone 'https://git.yandere.cc/Anon/YandereLewdBot.git'
cd yandereLewdBot/
python -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install -r requierements.txt
pip install -r requirements.txt
deactivate
cp ./bin/cfg_default.py ./bin/cfg.py
<chmod.txt xargs -i chmod +x '{}'
# Generate the default folder structure (if you modify these steps, you must reflect them in the cfg.py file)
mkdir md5
mkdir -p rsc/{safe,nsfw}
cp -vn ./default/cfg.py ./src/cfg.py
./run.sh -h
```
If everything worked correctly you should see usage information on Yandere Lewd Bot.
@ -59,6 +39,7 @@ yandereLewdBot -h
```
For Debian or Ubuntu based distros I believe you need to change python with python3 for the package and command name `¯\_(ツ)_/¯`
## Generating your OAuth Tokens
Before you can begin posting from the bot, you must first create an account on the instance of your choice, and then generate your OAuth tokens.
@ -76,7 +57,7 @@ If you did everything correctly you should see `Success! :)` at the end of the t
```text
settings_server = OrderedDict([
"app_name": "app",
"api_base_url": "https://neckbeard.xyz",
"api_base_url": "https://yandere.cc",
"client_id": "Long String of Text",
"client_secret": "Long String of Text",
"access_token": "Long String of Text"
@ -89,24 +70,15 @@ settings_encrypt = {
"salt": "",
}
```
If you used encryption, everything in the `settings_server` dictionary will be encrypted and you will have to enter your password every time you start the bot. Your `settings_encrypt` will look like this:
```text
settings_encrypt = {
"encrypt": True,
"salt": "A Short String of Text",
}
```
If you used encryption, everything in the `settings_server` dictionary will be encrypted and you will have to enter your password every time you start the bot. Copy and paste these values from the terminal into your `src/cfg.py` file. **Make sure you paste over or delete the placeholder values with the same names.**
Copy and paste these values from the terminal into your `bin/cfg.py` file. **Make sure you paste over or delete the placeholder values with the same names.**
## Posting
To begin posting:
- Make sure you already have a Pleroma account set up .
- Generate your OAuth tokens following the guide above.
- Put some images in the rsc/ folder (organize by safe and nsfw posts).
- 'safe' posts will be marked with `#yandere`
- 'nsfw' posts will be spoilered and marked as `#yandere #nsfw`
- cd into the root directory (the directory with `run.sh`)
- Make sure you are in the bot's root directory (the directory with `run.sh`)
- Start the bot with `./run.sh`
- Enter your password if you encrypted your OAuth tokens.
- If you symlinked the file in the [Installing](##installing) section you can simply run `yandereLewdBot` instead of changing directories and starting the bot with `./run.sh`
@ -117,6 +89,9 @@ To begin posting:
- Keep in mind that the bot's default visibility setting is set to unlisted for testing. You may want to update it to public.
- Read [docs/configuration.md](configuration.md) to customize the bot for your purposes.
# Donate
XMR: 493HynLQA4z71b3j9ZDXRNQudpdFW8GxeBGD8ahRctKn97RRurMVd35DqVqdAdjv68TcXTJWUwm6ee81ujDXGcmtKFixwQk
# Useful Tips and Commands
## Quickly Sum the Entire rsc/ Folder
To quickly sum everything in the `rsc/` folder, run the following commands:
@ -146,17 +121,8 @@ Ctrl+a ESC Page Up
# End scroll back
ESC
```
## A More Useful rsc/ Folder Structure
A more advanced (and useful) way of organizing images in the `rsc/` folder is by date added, group (such as a character name like Yuno Gasai), and safe/nsfw profiles. To do this, the following folder structure would be used: `rsc/year.month.day/character/safe_or_nsfw/image.png`
To configure this in the `settings_post` section, use the following for safe/nsfw repectivly:
```
setup_safe_profile("Yuno.safe", "./rsc/*/Yuno/safe/*", "#Yuno_Gasai #yandere")
setup_nsfw_profile("Yuno.nsfw", "./rsc/*/Yuno/nsfw/*", "#Yuno_Gasai #nsfw #yandere")
```
Notice the wildcard character `'*'` is used in place of year.month.day. This will match any folder in the resource folder, and all of our folders will be in order of when we added them.
## A Master Blacklist
The default configuration file has the following settings below (these files will not exist by default. The bot will simply ignore blacklist hash files that it can't open). The _r stands for read and the _w stands for write. This will ensure that the master_blacklist.txt is always read, but is never written to. This is intended for the user to manually add GNU formatted hashes to master_blacklist.txt in case they want to make especially sure that hashes and paths that are matched in the list are never uploaded accidentally.
The default configuration file has the following settings below (these files will not exist by default. The bot will simply ignore blacklist hash files that it can't open). The `_r` stands for read and the `_w` stands for write. This will ensure that the `master_blacklist.txt` is always read, but is never written to. This is intended for the user to manually add GNU formatted hashes to `master_blacklist.txt` in case they want to make especially sure that hashes and paths that are matched in the list are never uploaded accidentally.
```
"master_blacklist_r": ("./md5/blacklist.txt", "./md5/master_blacklist.txt"),
"master_blacklist_w": ("./md5/blacklist.txt",),