Don't download the same link several times
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s

This commit is contained in:
Nexus 2024-04-26 18:43:35 +01:00
parent 80348db530
commit b65073b1f8
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -261,7 +261,7 @@ class AutoResponder(commands.Cog):
files = []
self.log.info("Preparing to download: %s", ", ".join(map(ParseResult.geturl, links)))
async with aiohttp.ClientSession() as session:
for link in links:
for link in set(links):
if link.path.endswith(".pdf"):
buffer = io.BytesIO()
self.log.info("Downloading %s", link)