Remux validator Discord bot
Takes a Pastebin link with BDInfo and MediaInfo dump, and validates the remux.
Checks:
Video track names
Movie/TV name format
IMDB/TMDB ids
Filename
Video language matches first audio language
No muxing mode
Uses latest mkvtoolnix
Video and audio track names match
DTS-HD MA 1.0/2.0 to FLAC, LPCM 1.0/2.0 to FLAC, LPCM > 2.0 to DTS-HD MA
Commentary to AC-3 @ 224 kbps
Commentary track people and spellcheck
Subtitle order
Subtitle default flag
Should have chapters
Chapter languages
Chapter padding
- Pastebin
- Hastebin
- termbin
- {d}paste
- ghostbin.co
- Hey! Paste it
- CentOS Pastebin Service
- Paste.ee
- openSUSE Paste
Requires Python >= 3.5.4, tested with Python >= 3.7
Create a Discord bot and add it to a server.
Edit vdator/.env
and set DISCORD_BOT_SECRET
to your bot's token.
Request a TMDB API Key and set TMDB_API_KEY
.
Don't forget to create channels on the server and set them in vdator/.env
for REVIEW_CHANNELS
, REVIEW_REPLY_CHANNELS
, and BOT_CHANNELS
.
Use pip and virtual env to run vdator.
In the vdator
directory run:
python3 -m venv .
If the command fails to install pip, you will see an error similar to:
Error: Command '['python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Start over by creating a virutal environment without pip, and then install pip manually inside it:
python3 -m venv --without-pip .
source bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python3
deactivate
Install PyHunSpell
Install dependencies
source bin/activate
pip3 install -r requirements.txt
deactivate
source bin/activate
pip3 install -r requirements.txt --upgrade
pip3 freeze > requirements.txt
deactivate
Run the bot manually for testing, exceptions will get printed:
source bin/activate
python3 main.py
Create a systemd service to run vdator, /etc/systemd/system/vdator.service
[Unit]
Description=vdator
After=multi-user.target
[Service]
WorkingDirectory=/home/USER/vdator/venv/vdator
User=
Group=
ExecStart=/home/USER/vdator/venv/bin/python3 /home/USER/vdator/venv/vdator/main.py
Type=idle
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
Set User
to the user to run vdator as, and Group
to the user's group (list with groups
), usually both are the username.
Replace /home/USER/vdator/venv/
with the full path to your venv.
Run systemctl enable vdator
to start on boot. Use systemctl to start/stop vdator, systemctl start vdator
, systemctl stop vdator
, systemctl restart vdator
black .
Type !help
in one of the bot channels for more information.
Edit vdator/data/urls.json
and add your pastebin site.
# hostname
'example.com': {
# regex to get paste's unique identifier
'slug_regex': 'https://example.com/(.*)',
# link to raw text using {} in place of the unique identifier
'raw_url': 'https://example.com/raw/{}'
}
Run with python api.py
Example using Postman:
POST http://127.0.0.1:5000/text
Body, raw
[INSERT TEXT HERE]
Gives back json:
{
"discord_reply":"...",
"html_reply":"..."
}
discord_reply - the text that the bot usually sends to discord
html_reply - discord text formatted as html
Insert the html_reply
text into the example_html_viewer.html
to see it formatted simialr to discord.