Compare commits
4 Commits
034397535a
...
edcf1a063c
Author | SHA1 | Date | |
---|---|---|---|
edcf1a063c | |||
a7df40ae62 | |||
0637cb6217 | |||
95608bfe2d |
182
default/cfg_netoge.py
Normal file
182
default/cfg_netoge.py
Normal file
@ -0,0 +1,182 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
|
||||
def setup_episode(profile_name, path, frames, _skip, _nsfw, output_name, message, message_nsfw):
|
||||
return {
|
||||
"profile_name": profile_name,
|
||||
"path": path,
|
||||
"frames": frames,
|
||||
"skip": _skip,
|
||||
"nsfw": _nsfw,
|
||||
"output_name": output_name,
|
||||
"message": (message,),
|
||||
"message_nsfw": (message_nsfw,),
|
||||
"render_script": "./src/render_netoge_script.sh"
|
||||
}
|
||||
|
||||
|
||||
# Client credentials: >>>NEVER GIVE THESE OUT TO ANYONE<<<
|
||||
# Use the create_app.py script and follow the prompts to generate your tokens. Once generated, copy & paste them below.
|
||||
settings_server = OrderedDict([
|
||||
("app_name", "generated from create_app.py"),
|
||||
("api_base_url", "generated from create_app.py"),
|
||||
("client_id", "generated from create_app.py"),
|
||||
("client_secret", "generated from create_app.py"),
|
||||
("access_token", "generated from create_app.py")
|
||||
])
|
||||
|
||||
settings_reminder = "08/17/2023 11:59PM"
|
||||
|
||||
# Encryption settings: When using encryption the bot will ask you for your password before logging into your instance.
|
||||
# Use create_app.py and follow the instructions. Select yes when it asks you if you want to encrypt your credentials.
|
||||
# Paste the output below and never change the values.
|
||||
# If you want to encrypt or re-encrypt settings_server you can use encryption.py (or just regenerate your tokens)
|
||||
settings_encrypt = {
|
||||
"encrypt": False,
|
||||
"salt": ""
|
||||
}
|
||||
|
||||
# Basic settings to configure Yandere Bot's behavior
|
||||
settings_behavior = {
|
||||
"visibility": "private",
|
||||
"feature_set": "pleroma",
|
||||
"sleep_seconds": 20*60,
|
||||
"uploads_per_post": 1,
|
||||
"retry_seconds": 15,
|
||||
"delete_after_upload": True,
|
||||
"target": None,
|
||||
"content_type": "text/plain",
|
||||
"content_newline": "\n",
|
||||
"post_image_link": False,
|
||||
"debug": False
|
||||
}
|
||||
|
||||
# Time string formats
|
||||
settings_time = {
|
||||
"time_format": "%I:%M%p",
|
||||
"time_format_seconds": "%I:%M:%S%p",
|
||||
"date_format": "%m/%d/%Y",
|
||||
"long_date_format": "%m/%d/%Y %I:%M%p",
|
||||
"long_date_seconds_format": "%m/%d/%Y %I:%M:%S%p",
|
||||
"long_date_week": "%m/%d/%Y %I:%M%p, %A",
|
||||
"datetime": "%Y.%m.%d_%I.%M.%S%p"
|
||||
}
|
||||
|
||||
# The final frame (in seconds)
|
||||
end_frame = {
|
||||
"netoge_ep01": 24*60+42.816,
|
||||
"netoge_ep02": 24*60+41.731,
|
||||
"netoge_ep03": 24*60+39.771,
|
||||
"netoge_ep04": 24*60+39.813,
|
||||
"netoge_ep05": 24*60+38.603,
|
||||
"netoge_ep06": 24*60+40.23,
|
||||
"netoge_ep07": 24*60+40.021,
|
||||
"netoge_ep08": 24*60+41.147,
|
||||
"netoge_ep09": 24*60+42.899,
|
||||
"netoge_ep10": 24*60+39.771,
|
||||
"netoge_ep11": 24*60+40.271,
|
||||
"netoge_ep12": 24*60+40.146
|
||||
}
|
||||
|
||||
# Tuple of time ranges to skip (in seconds)
|
||||
skip = {
|
||||
"netoge_ep01": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(1367.282, end_frame["netoge_ep01"]) # ED
|
||||
),
|
||||
"netoge_ep02": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(121.037, 210.69), # OP
|
||||
(1381.671, end_frame["netoge_ep02"]) # ED
|
||||
),
|
||||
"netoge_ep03": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(84.959, 174.882), # OP
|
||||
(1379.794, end_frame["netoge_ep03"]) # ED
|
||||
),
|
||||
"netoge_ep04": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(191.315, 281.239), # OP
|
||||
(1379.836, end_frame["netoge_ep04"]) # ED
|
||||
),
|
||||
"netoge_ep05": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(72.989, 162.912), # OP
|
||||
(1468.633, end_frame["netoge_ep05"]) # ED
|
||||
),
|
||||
"netoge_ep06": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(162.245, 252.21), # OP
|
||||
(1308.181, 1398.188), # ED1
|
||||
(1470.26, end_frame["netoge_ep06"]) # ED2
|
||||
),
|
||||
"netoge_ep07": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(124.207, 214.13), # OP
|
||||
(1380.086, end_frame["netoge_ep07"]) # ED
|
||||
),
|
||||
"netoge_ep08": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(106.481, 196.487), # OP
|
||||
(1471.177, end_frame["netoge_ep08"]) # ED
|
||||
),
|
||||
"netoge_ep09": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(93.801, 183.808), # OP
|
||||
(1383.381, end_frame["netoge_ep09"]) # ED
|
||||
),
|
||||
"netoge_ep10": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(144.227, 234.15), # OP
|
||||
(1469.843, end_frame["netoge_ep10"]) # ED
|
||||
),
|
||||
"netoge_ep11": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(122.205, 212.128), # OP
|
||||
(1380.337, end_frame["netoge_ep11"]) # ED
|
||||
),
|
||||
"netoge_ep12": (
|
||||
(0, 30.154), # Funimation Shill
|
||||
(121.245, 211.169) # OP
|
||||
)
|
||||
}
|
||||
|
||||
# Tuple of time ranges to mark as sensative (in seconds)
|
||||
nsfw = {
|
||||
"netoge_ep01": (tuple()),
|
||||
"netoge_ep02": (tuple()),
|
||||
"netoge_ep03": (tuple()),
|
||||
"netoge_ep04": (tuple()),
|
||||
"netoge_ep05": (tuple()),
|
||||
"netoge_ep06": (tuple()),
|
||||
"netoge_ep07": (tuple()),
|
||||
"netoge_ep08": (tuple()),
|
||||
"netoge_ep09": (tuple()),
|
||||
"netoge_ep10": (tuple()),
|
||||
"netoge_ep11": (tuple()),
|
||||
"netoge_ep12": (tuple()),
|
||||
}
|
||||
|
||||
# Regular episodes
|
||||
start_episode = 1
|
||||
end_episode = 12
|
||||
profile_name = "netoge_ep{}"
|
||||
rsc_name = "/home/anon/Videos/Netoge/[HorribleSubs] Netoge no Yome wa Onnanoko ja Nai to Omotta - {} [1080p].mkv"
|
||||
screenshot_folder = "/tmp/Netoge_EP{}_${{frame}}.jpg"
|
||||
msg = "#Netoge #yandere"
|
||||
msg_nsfw = "#Netoge #yandere #nsfw"
|
||||
|
||||
# Use a list comprehension and convert it to a tuple since
|
||||
# regular episodes are named in ascending order
|
||||
settings_post = tuple((
|
||||
setup_episode(
|
||||
profile_name .format(i),
|
||||
rsc_name .format(i),
|
||||
end_frame [profile_name.format(i)],
|
||||
skip [profile_name.format(i)],
|
||||
nsfw [profile_name.format(i)],
|
||||
screenshot_folder .format(i),
|
||||
msg .format(i),
|
||||
msg_nsfw .format(i)
|
||||
) for i in (str(x).zfill(2) for x in range(start_episode, end_episode + 1))
|
||||
))
|
38
src/render_netoge_script.sh
Executable file
38
src/render_netoge_script.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
# src/render_script.sh
|
||||
|
||||
# ISSUES:
|
||||
# - https://github.com/mpv-player/mpv/issues/5498
|
||||
# MPV has an issue when outputting to jpg.
|
||||
# Colors look washed out and faded compared to png screenshots.
|
||||
# As a workaround this script will output to png then convert to jpg.
|
||||
#
|
||||
# - https://trac.ffmpeg.org/ticket/2391
|
||||
# I want to just use ffmpeg for this script, however it
|
||||
# does not support dvd subtitles. For now, I have to
|
||||
# rely on mpv to render dvdsubs correctly :(
|
||||
|
||||
# TODO:
|
||||
# - Tidy up this script and add some safety checks
|
||||
# - Add some logic to the bot to detect if this script failed
|
||||
# - Research more mpv options to avoid having to use mpv + convert
|
||||
|
||||
# Requiered args supplied by the bot
|
||||
INPUT_PATH="$1"
|
||||
OUTPUT_PATH="$2"
|
||||
PICKED_FRAME="$3"
|
||||
|
||||
PNG_PATH="${OUTPUT_PATH%.*}.png"
|
||||
|
||||
echo "$INPUT_PATH"
|
||||
echo "$OUTPUT_PATH"
|
||||
echo "$PICKED_FRAME"
|
||||
|
||||
mkdir -p "$(dirname "$OUTPUT_PATH")"
|
||||
mkdir -p "$(dirname "$PNG_PATH")"
|
||||
|
||||
mpv "$INPUT_PATH" "--start=${PICKED_FRAME}" --frames=1 -o "$PNG_PATH"
|
||||
convert -quality 95 "$PNG_PATH" "$OUTPUT_PATH"
|
||||
|
||||
rm -fv "$PNG_PATH"
|
Reference in New Issue
Block a user