fixed filename output to not be a url
This commit is contained in:
parent
73679351d3
commit
5b8c433e95
2 changed files with 4 additions and 2 deletions
|
|
@ -26,7 +26,9 @@ class YoutubeDL(BotBaseCog):
|
||||||
async def check_for_downloads(self):
|
async def check_for_downloads(self):
|
||||||
for file in os.listdir("data/ytdl"):
|
for file in os.listdir("data/ytdl"):
|
||||||
if file.endswith(".txt"):
|
if file.endswith(".txt"):
|
||||||
await self.bot.get_channel(544408659174883328).send(f"{file[:-4]}")
|
with open(f"data/ytdl/{file}", "r") as f:
|
||||||
|
url = f.read()
|
||||||
|
await self.bot.get_channel(544408659174883328).send(f"{url}")
|
||||||
os.remove(f"data/ytdl/{file}")
|
os.remove(f"data/ytdl/{file}")
|
||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ def main():
|
||||||
zip_file = zip_all_files()
|
zip_file = zip_all_files()
|
||||||
output_url = upload_to_litterbox(zip_file)
|
output_url = upload_to_litterbox(zip_file)
|
||||||
print(output_url)
|
print(output_url)
|
||||||
with open(f"data/ytdl/{output_url}.txt", "w") as output_file:
|
with open(f"data/ytdl/{time.time()}.txt", "w") as output_file:
|
||||||
output_file.write(output_url)
|
output_file.write(output_url)
|
||||||
output_file.close()
|
output_file.close()
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue