Исправление пару багов
This commit is contained in:
+3
-2
@@ -15,6 +15,7 @@ logger = logging.getLogger(__name__)
|
||||
# Bot token from @BotFather
|
||||
CONFIG = read()
|
||||
BOT_TOKEN = CONFIG['api_token']
|
||||
YT_DLP = CONFIG['ytdlp_way']
|
||||
|
||||
bot = telebot.TeleBot(BOT_TOKEN)
|
||||
|
||||
@@ -45,7 +46,7 @@ def handle_youtube_music_link(message):
|
||||
|
||||
# Step 1: Get metadata using yt-dlp in simulate mode
|
||||
result = subprocess.run(
|
||||
["yt-dlp", "--print-json", "--skip-download", "--restrict-filenames", url],
|
||||
[YT_DLP, "--print-json", "--skip-download", "--restrict-filenames", url],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
@@ -73,7 +74,7 @@ def handle_youtube_music_link(message):
|
||||
output_template = f"{user.id}_%(title)s.%(ext)s"
|
||||
download_result = subprocess.run(
|
||||
[
|
||||
"yt-dlp",
|
||||
YT_DLP,
|
||||
"-x", "--audio-format", "mp3", "--audio-quality", "0",
|
||||
"--output", output_template,
|
||||
"--restrict-filenames",
|
||||
|
||||
Reference in New Issue
Block a user