mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-18 15:52:10 +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))
|
text = file_bytes.decode(encoding=check.group(1))
|
||||||
self.logger.info(text)
|
self.logger.info(text)
|
||||||
lines = text.split("\n")
|
lines = text.split("\n")
|
||||||
for item in lines:
|
for link in lines:
|
||||||
self.logger.info(item)
|
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:
|
else:
|
||||||
ctx.reply("Spierdalaj")
|
ctx.reply("Spierdalaj")
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -150,9 +150,10 @@ async def get_file(ctx, source, link):
|
|||||||
elif source == "Youtube":
|
elif source == "Youtube":
|
||||||
link_ok = False
|
link_ok = False
|
||||||
pat = r"^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$"
|
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
|
link_ok = True
|
||||||
|
|
||||||
|
|
||||||
if link_ok:
|
if link_ok:
|
||||||
dir_path = ""
|
dir_path = ""
|
||||||
file_list = []
|
file_list = []
|
||||||
|
|||||||
Reference in New Issue
Block a user