fix(extra/transcript): update for youtube_transcript_api
This commit is contained in:
8
extra.py
8
extra.py
@@ -24,21 +24,21 @@ async def transcript(
|
|||||||
await message.channel.send("(autogenerated)")
|
await message.channel.send("(autogenerated)")
|
||||||
|
|
||||||
messages = []
|
messages = []
|
||||||
for line in transcript:
|
for line in transcript.snippets:
|
||||||
if (
|
if (
|
||||||
players[message.guild.id].current.player.original.progress
|
players[message.guild.id].current.player.original.progress
|
||||||
>= line["start"] + line["duration"]
|
>= line.start + line.duration
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
while (
|
while (
|
||||||
players[message.guild.id].current.player.original.progress < line["start"]
|
players[message.guild.id].current.player.original.progress < line.start
|
||||||
):
|
):
|
||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
|
|
||||||
messages.insert(
|
messages.insert(
|
||||||
0,
|
0,
|
||||||
await message.channel.send(line["text"].upper() if upper else line["text"]),
|
await message.channel.send(line.text.upper() if upper else line.text),
|
||||||
)
|
)
|
||||||
if len(messages) > max_messages:
|
if len(messages) > max_messages:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user