mirror of
https://github.com/LibraHp/GetQzonehistory.git
synced 2024-12-27 06:29:55 +00:00
优化未删除说说合并至主线程代码
This commit is contained in:
parent
79eaa7d407
commit
5072295eb3
7
main.py
7
main.py
@ -221,11 +221,6 @@ def open_file(file_path):
|
||||
print(f"Unsupported OS: {platform.system()}")
|
||||
|
||||
|
||||
def get_content_from_split(content):
|
||||
content_split = str(content).split(":")
|
||||
return content_split[1].strip() if len(content_split) > 1 else content.strip()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
user_info = Request.get_login_user_info()
|
||||
@ -277,7 +272,7 @@ if __name__ == '__main__':
|
||||
if user_moments and len(user_moments) > 0:
|
||||
# 如果可见说说的内容是从消息列表恢复的说说内容子集,则不添加到消息列表中
|
||||
texts = [t for t in texts if
|
||||
not any(get_content_from_split(u[1]) in get_content_from_split(t[1]) for u in user_moments)]
|
||||
not any(Tools.is_any_mutual_exist(t[1], u[1]) for u in user_moments)]
|
||||
texts.extend(user_moments)
|
||||
except Exception as err:
|
||||
print(f"获取未删除QQ空间记录发生异常: {str(err)}")
|
||||
|
@ -237,3 +237,14 @@ def replace_em_to_img(match):
|
||||
emoji_code = match.group(1)
|
||||
return f'<img src="http://qzonestyle.gtimg.cn/qzone/em/{emoji_code}.gif" alt="{emoji_code}">'
|
||||
|
||||
|
||||
def get_content_from_split(content):
|
||||
content_split = str(content).split(":")
|
||||
return content_split[1].strip() if len(content_split) > 1 else content.strip()
|
||||
|
||||
|
||||
# 判断两个字符串是否存在互相包含的情况
|
||||
def is_any_mutual_exist(str1, str2):
|
||||
str1 = get_content_from_split(str1)
|
||||
str2 = get_content_from_split(str2)
|
||||
return str1 in str2 or str2 in str1
|
||||
|
Loading…
Reference in New Issue
Block a user