From 990e2147fc3eb6c4a1e0d1a5260fa307c12775e3 Mon Sep 17 00:00:00 2001 From: HLeiTR Date: Thu, 22 Aug 2024 23:18:34 -0400 Subject: [PATCH] [+] Moved auth to rei.py --- Dockerfile | 4 ---- Rei/rei.py | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35507c8..13dd53b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,10 +10,6 @@ RUN pip install -r requirements.txt # Install OAuth2 plugin RUN python3 -m pip install -U https://github.com/coletdjnz/yt-dlp-youtube-oauth2/archive/refs/heads/master.zip -# For obtaining -RUN echo "Waiting for OAuth2" -RUN yt-dlp --username 'oauth2' --password '' --skip-download https://youtu.be/dQw4w9WgXcQ?si=bj7kO-C3zGc7dAAc - RUN apk add ffmpeg RUN apk add opus RUN apk add libffi-dev diff --git a/Rei/rei.py b/Rei/rei.py index 36ae03e..c755840 100644 --- a/Rei/rei.py +++ b/Rei/rei.py @@ -74,7 +74,7 @@ raise RuntimeError('Opus failed to load') # Change the version string every update -version = 'July 15, 2024 8:00 PM' +version = 'August 22, 2024 11:00 PM' @client.event async def on_ready() -> None: @@ -87,6 +87,13 @@ async def on_ready() -> None: logger.info('Rei Bot is ready!') logger.info(f'Version: {version}') + # Run a dry run for obtaining OAuth2 Device Token + logger.info('Waiting for OAuth2 Authentication...') + with yt_dlp.YoutubeDL(YDL_OPTS_STREAM) as ydl: + info_dict = ydl.extract_info("https://www.youtube.com/watch?v=dQw4w9WgXcQ", download=False) + + logger.info('OAuth2 Authenticated!') + @client.event async def on_voice_state_update(member: discord.Member,