diff --git a/beem/cli.py b/beem/cli.py index ec19930d1a6cba4fd3b6346032de496cb5c7b81c..44c554ffbf0f5856ed7992253fb42f6c65601463 100644 --- a/beem/cli.py +++ b/beem/cli.py @@ -2506,8 +2506,8 @@ def download(permlink, account, save, export): if len(permlink) > 1: print(authorperm) comment = Comment(authorperm, blockchain_instance=stm) - if comment["parent_author"] != "" and comment["parent_permlink"] != "": - reply_identifier = construct_authorperm(comment["parent_author"], comment["parent_permlink"]) + if comment.parent_author != "" and comment.parent_permlink != "": + reply_identifier = construct_authorperm(comment.parent_author, comment.parent_permlink) else: reply_identifier = None @@ -2524,7 +2524,10 @@ def download(permlink, account, save, export): yaml_prefix += 'canonical_url: %s\n' % comment.json_metadata["canonical_url"] if "app" in comment.json_metadata: yaml_prefix += 'app: %s\n' % comment.json_metadata["app"] - yaml_prefix += 'last_update: %s\n' % comment.json()["last_update"] + if "last_update" in comment.json(): + yaml_prefix += 'last_update: %s\n' % comment.json()["last_update"] + else: + yaml_prefix += 'last_update: %s\n' % comment.json()["updated"] yaml_prefix += 'max_accepted_payout: %s\n' % str(comment["max_accepted_payout"]) if "percent_steem_dollars" in comment: yaml_prefix += 'percent_steem_dollars: %s\n' % str(comment["percent_steem_dollars"]) diff --git a/beem/comment.py b/beem/comment.py index f16775ae941a48ea3709cc7080fd593884d54840..ca70af86264fc91d9d9b1704454ec8696b0cedbc 100644 --- a/beem/comment.py +++ b/beem/comment.py @@ -269,11 +269,17 @@ class Comment(BlockchainObject): @property def parent_author(self): - return self["parent_author"] + if "parent_author" in self: + return self["parent_author"] + else: + return "" @property def parent_permlink(self): - return self["parent_permlink"] + if "parent_permlink" in self: + return self["parent_permlink"] + else: + return "" @property def depth(self):