def _comment_exists(self):
"""
This is yet another horrible workaround to keep this from falling apart.
Because of the other workarounds to get around the fact that you
cannot get metadata from a comment, we've run into problems where it
is not always obvious if a comment even exists. For this reason, we
need to have a method to test it for us.
"""
try:
# Getting the reply data from a comment should raise an error if
# it doesn't exist. We use Comment's get_reply_data because
# ProgramCommentReply's get_reply_data is another one of those
# horrible workarounds
list(Comment(self.id, self.get_program()).get_reply_data())
except requests.HTTPError:
return False
return True
评论列表
文章目录