log info about ytdl
This commit is contained in:
parent
dfc43de1a0
commit
7237cb8da9
1 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import logging
|
||||||
|
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from cogs.base_cog.bot_base_cog import BotBaseCog
|
from cogs.base_cog.bot_base_cog import BotBaseCog
|
||||||
|
|
@ -19,9 +20,9 @@ class YoutubeDL(BotBaseCog):
|
||||||
video_or_audio = ctx.message.content.split(" ")[2]
|
video_or_audio = ctx.message.content.split(" ")[2]
|
||||||
process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio])
|
process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio])
|
||||||
process.wait()
|
process.wait()
|
||||||
print(process.stdout.read())
|
logging.info(process.stdout.read())
|
||||||
print(process.stderr.read())
|
logging.info(process.stderr.read())
|
||||||
print(process.returncode)
|
logging.info(process.returncode)
|
||||||
await ctx.send(f"Downloading {video_or_audio} from {url}...", suppress_embeds=True)
|
await ctx.send(f"Downloading {video_or_audio} from {url}...", suppress_embeds=True)
|
||||||
except:
|
except:
|
||||||
await ctx.send("Usage: !youtubedl <url> <video|audio>")
|
await ctx.send("Usage: !youtubedl <url> <video|audio>")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue