mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
moving api key to netrc
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
import logging
|
import logging
|
||||||
import wave
|
import wave
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import netrc
|
||||||
import assemblyai as aai
|
import assemblyai as aai
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands, voice_recv, tasks
|
from discord.ext import commands, voice_recv, tasks
|
||||||
from discord.opus import Decoder as OpusDecoder
|
from discord.opus import Decoder as OpusDecoder
|
||||||
import time
|
import time
|
||||||
|
|
||||||
# Replace with your API key
|
# Replace with your API key
|
||||||
aai.settings.api_key = "aa9962f0088a449a9c4ab2361e96cc08"
|
NETRC_FILE = "/home/pi/.netrc"
|
||||||
|
netrc_mod = netrc.netrc(NETRC_FILE)
|
||||||
|
authTokens = netrc_mod.authenticators("assemblyai")
|
||||||
|
aai.settings.api_key = authTokens[2]
|
||||||
|
|
||||||
discord.opus._load_default()
|
discord.opus._load_default()
|
||||||
CHANNELS = OpusDecoder.CHANNELS
|
CHANNELS = OpusDecoder.CHANNELS
|
||||||
SAMPLE_WIDTH = OpusDecoder.SAMPLE_SIZE // OpusDecoder.CHANNELS
|
SAMPLE_WIDTH = OpusDecoder.SAMPLE_SIZE // OpusDecoder.CHANNELS
|
||||||
|
|||||||
Reference in New Issue
Block a user