refine the logic for handling anchor_name (#466)

This commit is contained in:
Max-Tortoise 2024-07-07 11:38:07 +08:00 committed by GitHub
parent 5e0a736044
commit f2e395405b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

13
main.py
View File

@ -979,11 +979,14 @@ def start_record(url_data: tuple, count_variable: int = -1):
return
if anchor_name:
anchor_split: list = anchor_name.split('主播:')
if len(anchor_split) > 1 and anchor_split[1].strip():
anchor_name = anchor_split[1].strip()
else:
anchor_name = port_info.get("anchor_name", '')
# 第一次从config中读取带有'主播:',去除'主播:'
# 之后的线程循环,已经是处理后的结果,不需要去处理
if '主播:' in anchor_name:
anchor_split: list = anchor_name.split('主播:')
if len(anchor_split) > 1 and anchor_split[1].strip():
anchor_name = anchor_split[1].strip()
else:
anchor_name = port_info.get("anchor_name", '')
else:
anchor_name = port_info.get("anchor_name", '')