| | |
| | | if lines: |
| | | self.__video_data_cache_dict = eval(lines[0]) |
| | | |
| | | def is_need_click(self, video_name, video_time, comment_count): |
| | | def is_need_click(self, video_info): |
| | | """ |
| | | 是否需要点击 |
| | | :param video_name: 视频名称 |
| | | :param video_time: 视频时间 |
| | | :param comment_count: 评论数量 |
| | | :param video_info: |
| | | :return: |
| | | """ |
| | | video_name, video_time, comment_count = video_info[0], video_info[1], video_info[2] |
| | | k = f"{video_name}{video_time}" |
| | | if k not in self.__video_data_cache_dict: |
| | | return True |
| | | if comment_count - self.__video_data_cache_dict[k][0] > 0: |
| | | if int(comment_count) - int(self.__video_data_cache_dict[k][0]) > 0: |
| | | return True |
| | | return False |
| | | |
| | |
| | | # 保存到文件 |
| | | with open(self.__video_cache_path, encoding="utf-8", mode='w') as f: |
| | | f.write(f"{self.__video_data_cache_dict}") |
| | | |