This commit is contained in:
Сергей Маринкевич
2026-06-05 15:21:06 +07:00
parent 99dc9f173d
commit e440cae3e6
+6 -2
View File
@@ -326,7 +326,12 @@ def export_channel(d: Driver, channel: str, user_id_to_name: Dict[str, str], out
print("Exporting channel", channel_name) print("Exporting channel", channel_name)
after_ts = _parse_filter_timestamp(after) if after else None after_ts = _parse_filter_timestamp(after) if after else None
before_ts = _parse_filter_timestamp(before) if before else None before_ts = _parse_filter_timestamp(before) if before else None
if after: filtered_channel_name = ''.join(filter(lambda ch: ch not in "?!/\\.;:*\"<>|", channel_name))
output_filepath = pathlib.Path(output_base) / channel_name / (filtered_channel_name + ".json")
if merge and after_ts is not None and not output_filepath.exists():
print(" no existing export for this channel, fetching full history")
after_ts = None
elif after:
print(f" fetching posts after {after}") print(f" fetching posts after {after}")
# Get all posts for selected channel # Get all posts for selected channel
@@ -416,7 +421,6 @@ def export_channel(d: Driver, channel: str, user_id_to_name: Dict[str, str], out
simple_post["files"] = filenames simple_post["files"] = filenames
simple_posts.append(simple_post) simple_posts.append(simple_post)
filtered_channel_name = ''.join(filter(lambda ch: ch not in "?!/\\.;:*\"<>|", channel_name))
output_filename = filtered_channel_name + ".json" output_filename = filtered_channel_name + ".json"
output_filepath = output_base / output_filename output_filepath = output_base / output_filename