Skip to content

Commit

Permalink
[+] Moved auth to rei.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Lei-Tin committed Aug 23, 2024
1 parent 5325f1f commit 990e214
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion Rei/rei.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 990e214

Please sign in to comment.