fix stats, add files to help with setup

This commit is contained in:
insert 2024-10-19 08:28:11 -04:00
parent f05d4289e5
commit 0aab1dffdd
Signed by: insert
GPG key ID: A70775C389ACF105
5 changed files with 20 additions and 2 deletions

8
.env.example Normal file
View file

@ -0,0 +1,8 @@
TOKEN=""
GUILD_ID=""
MAX_MIN="8"
MAX_QUEUE="5"
ALLOW_SKIP="TRUE"
PERMANENT_MAX_QUEUE="FALSE"
LOCK_SHUFFLE="FALSE"
PROXY="socks5://your-proxy-here-or-comment-out-the-line-in-newbot.py"

View file

@ -228,7 +228,7 @@ async def stats(inter: disnake.AppCmdInter):
message = message + f"Title: {nowplaying.input_settings['text']}\n"
playing = obs.get_media_input_status("player")
message = message + f"Video Duration: {str(datetime.timedelta(seconds=(round(playing.media_cursor/1000))))}/{str(datetime.timedelta(seconds=(round(playing.media_duration/1000))))}\n"
if inter.permissions.moderate_members and not os.getenv("PERMANENT_MAX_QUEUE",False):
if inter.permissions.moderate_members and not (os.getenv("PERMANENT_MAX_QUEUE","FALSE") == "TRUE"):
message = message + f"Queued by <@{user_queue[0]}>"
await inter.edit_original_response(message)
@ -530,6 +530,7 @@ async def ensurewaiting():
if playing.media_cursor == None:
obs.set_current_program_scene("error")
if len(os.listdir(full_dl_dir)) == 0 and len(queue) >= 1: #just in case
loop = asyncio.get_running_loop()
await loop.run_in_executor(None, download_video, 0)
@tasks.loop(seconds=5)
@ -548,4 +549,5 @@ async def titlehandler():
bot.run(os.getenv("TOKEN"))
print("cleaning up tempdir")
temp_dir.cleanup()
download_dir.cleanup()
download_dir.cleanup()
obs.set_current_program_scene("nosignal")

2
requirements.txt Normal file
View file

@ -0,0 +1,2 @@
disnake
obsws_python

View file

@ -10,6 +10,7 @@ pkgs.mkShell {
pkgs.python311Packages.python-dotenv
pkgs.python311Packages.venvShellHook
pkgs.ffmpeg
pkgs.icewm
pkgs.discord
];
venvDir = "./.venv";

5
wm.sh Executable file
View file

@ -0,0 +1,5 @@
Xwayland -geometry 1920x1080 -fullscreen :12 &
sleep 2
DISPLAY=:12 icewm --display=:12 &
env -u WAYLAND_DISPLAY DISPLAY=:12 obs --disable-shutdown-check --startstreaming --startvirtualcam --multi --disable-missing-files-check --scene nosignal &
env DISPLAY=:12 vlc -f srt://127.0.0.1:9999?transtype=live