Skip to content

Bulk asynchronous downloader for multiple file hosts

fix output_last_post

Jules-WinnfieldXfe2914beeda9
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 8c904cc5c..e26b18672 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "4.2.32"
+__version__ = "4.2.33"
diff --git a/cyberdrop_dl/base_functions/base_functions.py b/cyberdrop_dl/base_functions/base_functions.py
index 1fdf79f0c..8876dcda2 100644
--- a/cyberdrop_dl/base_functions/base_functions.py
+++ b/cyberdrop_dl/base_functions/base_functions.py
@@ -182,5 +182,5 @@ class ErrorFileWriter:
if not self.output_last_post:
return
- async with aiofiles.open(self.last_post, 'w') as f:
+ async with aiofiles.open(self.last_post, 'a') as f:
await f.write(f"{url}\n")
diff --git a/cyberdrop_dl/crawlers/Xenforo_Spider.py b/cyberdrop_dl/crawlers/Xenforo_Spider.py
index e5ad01ca7..2e7fc445b 100644
--- a/cyberdrop_dl/crawlers/Xenforo_Spider.py
+++ b/cyberdrop_dl/crawlers/Xenforo_Spider.py
@@ -332,13 +332,11 @@ class XenforoCrawler:
next_page = domain / next_page[1:]
next_page = URL(next_page)
await self.parse_forum(session, next_page, spec, cascade, title, post_number)
- elif self.output_last:
+ else:
assert url.raw_name is not None
if 'page-' in url.raw_name or 'post-' in url.raw_name:
last_post_url = url.parent / post_num_str
else:
last_post_url = url / post_num_str
await self.error_writer.write_last_post(last_post_url)
- async with aiofiles.open(self.output_last_file, mode='a') as f:
- await f.write(f'{last_post_url}\n')
return title