aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/music/play_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'cogs/music/play_commands.py')
-rw-r--r--cogs/music/play_commands.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cogs/music/play_commands.py b/cogs/music/play_commands.py
index fd5113a..a82fa9d 100644
--- a/cogs/music/play_commands.py
+++ b/cogs/music/play_commands.py
@@ -6,6 +6,7 @@
6import logging 6import logging
7import os 7import os
8import urllib.parse 8import urllib.parse
9import asyncio
9from os import PathLike 10from os import PathLike
10from typing import Awaitable, Callable, List, Tuple 11from typing import Awaitable, Callable, List, Tuple
11 12
@@ -139,9 +140,10 @@ class PlayCommands(commands.Cog):
139 local_path = os.path.join(self.temp_dir, filename) 140 local_path = os.path.join(self.temp_dir, filename)
140 os.makedirs(self.temp_dir, exist_ok=True) 141 os.makedirs(self.temp_dir, exist_ok=True)
141 142
143 loop = asyncio.get_event_loop()
142 with open(local_path, "wb") as f: 144 with open(local_path, "wb") as f:
143 async for chunk in response.content.iter_chunked(8192): 145 async for chunk in response.content.iter_chunked(8192):
144 f.write(chunk) 146 await loop.run_in_executor(None, f.write, chunk)
145 147
146 compressed_path = await media_processing.AudioCompressor.compress( 148 compressed_path = await media_processing.AudioCompressor.compress(
147 ctx, local_path 149 ctx, local_path