To add substitute yt-dlp, and return more search results.
This commit is contained in:
parent
665468a1a6
commit
4375c0d0a3
|
@ -159,7 +159,7 @@ class Commands:
|
|||
else:
|
||||
random.shuffle(songs)
|
||||
await send_message(target, "Multiple found:")
|
||||
for s in songs[:4]:
|
||||
for s in songs[:8]:
|
||||
await send_message(target, f"{s.utube_id} | {s.title}")
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -38,7 +38,8 @@ class YouTube:
|
|||
proc = await asyncio.create_subprocess_exec(
|
||||
*[
|
||||
#"/home/radio/ircradio/venv/bin/youtube-dl",
|
||||
"youtube-dl",
|
||||
"/home/radio/ircradio/venv/bin/yt-dlp",
|
||||
#"yt-dlp",
|
||||
"--add-metadata",
|
||||
"--write-all-thumbnails",
|
||||
"--write-info-json",
|
||||
|
@ -46,7 +47,7 @@ class YouTube:
|
|||
"--max-filesize", "30M",
|
||||
"--extract-audio",
|
||||
"--audio-format", "vorbis",
|
||||
"-o", f"{settings.dir_music}/%(id)s.ogg",
|
||||
"-o", f"{settings.dir_music}/%(id)s",
|
||||
f"https://www.youtube.com/watch?v={utube_id}"],
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE)
|
||||
|
@ -134,7 +135,7 @@ class YouTube:
|
|||
async def update():
|
||||
pip_path = os.path.join(os.path.dirname(sys.executable), "pip")
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
*[sys.executable, pip_path, "install", "--upgrade", "youtube-dl"],
|
||||
*[sys.executable, pip_path, "install", "--upgrade", "yt-dlp"],
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE)
|
||||
stdout, stderr = await proc.communicate()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
quart
|
||||
youtube-dl
|
||||
yt-dlp
|
||||
aiofiles
|
||||
aiohttp
|
||||
bottom
|
||||
|
|
Loading…
Reference in New Issue