From e440cae3e638acf5ab7474f655c48fb60bf0b3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=BA=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 5 Jun 2026 15:21:06 +0700 Subject: [PATCH] fup err --- mattermost-dl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mattermost-dl.py b/mattermost-dl.py index 54f736f..c75d39b 100644 --- a/mattermost-dl.py +++ b/mattermost-dl.py @@ -326,7 +326,12 @@ def export_channel(d: Driver, channel: str, user_id_to_name: Dict[str, str], out print("Exporting channel", channel_name) after_ts = _parse_filter_timestamp(after) if after 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}") # 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_posts.append(simple_post) - filtered_channel_name = ''.join(filter(lambda ch: ch not in "?!/\\.;:*\"<>|", channel_name)) output_filename = filtered_channel_name + ".json" output_filepath = output_base / output_filename