1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Search by default in dlmusic

This commit is contained in:
Steffo 2019-08-03 19:00:57 +02:00
parent aa5fdf4d40
commit ff15d4c883

View file

@ -23,9 +23,12 @@ class DlmusicCommand(Command):
@classmethod @classmethod
async def common(cls, call: Call): async def common(cls, call: Call):
url = call.args[0] url = call.args[0]
files: typing.List[YtdlVorbis] = await asyncify(YtdlVorbis.create_and_ready_from_url, url, **ytdl_args) if url.startswith("http://") or url.startswith("https://"):
for file in files: vfiles: typing.List[YtdlVorbis] = await asyncify(YtdlVorbis.create_and_ready_from_url, url, **ytdl_args)
await call.reply(f"⬇️ https://scaleway.steffo.eu/musicbot_cache/{urllib.parse.quote(file.vorbis_filename)}") else:
vfiles = await asyncify(YtdlVorbis.create_and_ready_from_url, f"ytsearch:{url}", **ytdl_args)
for vfile in vfiles:
await call.reply(f"⬇️ https://scaleway.steffo.eu/musicbot_cache/{urllib.parse.quote(vfile.vorbis_filename)}")
await asyncio.sleep(seconds_before_deletion) await asyncio.sleep(seconds_before_deletion)
for file in files: for vfile in vfiles:
file.delete() vfile.delete()