mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Batch download
This commit is contained in:
+10
-3
@@ -611,9 +611,16 @@ class MusicModule(commands.Cog):
|
||||
text = file_bytes.decode(encoding=check.group(1))
|
||||
self.logger.info(text)
|
||||
lines = text.split("\n")
|
||||
for item in lines:
|
||||
self.logger.info(item)
|
||||
|
||||
for link in lines:
|
||||
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
||||
if re.match(pat, link) and (re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)):
|
||||
self.logger.info("%s to link do jutuba", link)
|
||||
elif re.match(pat, link) and re.match(".*spotify.*", link):
|
||||
self.logger.info("%s to link do spotify", link)
|
||||
elif re.match(pat, link):
|
||||
self.logger.info("%s to link do czegos", link)
|
||||
else:
|
||||
ctx.reply("Spierdalaj")
|
||||
else:
|
||||
ctx.reply("Spierdalaj")
|
||||
|
||||
|
||||
+2
-1
@@ -150,9 +150,10 @@ async def get_file(ctx, source, link):
|
||||
elif source == "Youtube":
|
||||
link_ok = False
|
||||
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
||||
if re.match(pat, link) and re.match(".*youtube.*", link):
|
||||
if re.match(pat, link) and (re.match(".*youtube.*", link) or re.match(".*youtu.be.*", link)):
|
||||
link_ok = True
|
||||
|
||||
|
||||
if link_ok:
|
||||
dir_path = ""
|
||||
file_list = []
|
||||
|
||||
Reference in New Issue
Block a user