diff --git a/conversation.py b/conversation.py index 5080aa448..6d3c84a86 100644 --- a/conversation.py +++ b/conversation.py @@ -306,6 +306,7 @@ def download_conversation_posts(authorized: bool, session, session, as_header, debug, http_prefix, domain, 0, []) + ids = [] while get_json_valid(post_json_object): if not isinstance(post_json_object, dict): break @@ -355,6 +356,13 @@ def download_conversation_posts(authorized: bool, session, if not post_json_object['object'].get('published'): break + # avoid any circularity in previous conversation posts + if post_json_object.get('id'): + if isinstance(post_json_object['id'], str): + if post_json_object['id'] in ids: + break + ids.append(post_json_object['id']) + # render harmless any dangerous markup harmless_markup(post_json_object)