diff --git a/douyin/core/state/room_pos_map.csv b/douyin/core/state/room_pos_map.csv index c7c6e9b..106a5c5 100644 --- a/douyin/core/state/room_pos_map.csv +++ b/douyin/core/state/room_pos_map.csv @@ -1,2 +1,2 @@ pos,title,title_raw -0,哙小,哙~小 +0,海宁齐总,海宁齐总 diff --git a/douyin/core/state/room_pos_map.json b/douyin/core/state/room_pos_map.json index 456c80f..aa0ab86 100644 --- a/douyin/core/state/room_pos_map.json +++ b/douyin/core/state/room_pos_map.json @@ -1,11 +1,11 @@ { "0": [ - "哙小", - "哙~小" + "海宁齐总", + "海宁齐总" ], "_meta": { "source": "C:\\Users\\12742\\Desktop\\douyin_guaji-main\\douyin\\core\\state\\room_pos_map.json", - "generated_ts": 1768465088, + "generated_ts": 1768465103, "run_id": "20260115161806" } } \ No newline at end of file diff --git a/douyin/core/state/room_pos_map.md b/douyin/core/state/room_pos_map.md index 3be641f..38c4beb 100644 --- a/douyin/core/state/room_pos_map.md +++ b/douyin/core/state/room_pos_map.md @@ -2,4 +2,4 @@ | 位置 | 标题 | 原始标题 | |-:|:-|:-| -| 0 | 哙小 | 哙~小 | +| 0 | 海宁齐总 | 海宁齐总 | diff --git a/douyin/fudai/core/fudai_attend.py b/douyin/fudai/core/fudai_attend.py index e4536a4..2c409e8 100644 --- a/douyin/fudai/core/fudai_attend.py +++ b/douyin/fudai/core/fudai_attend.py @@ -1128,7 +1128,7 @@ def attend_choujiang(analyser) -> bool: "参与", "点击指定位置或关闭详情页失败", error=str(e) ) - # 重新诊断阶段,确认是否还在粉丝团加入页 + # 重新诊断阶段,确认是否还在粉丝团加入页 try: # 删除:避免重复阶段诊断,减少截图/adb开销 st_after, seen_after = "", "" diff --git a/douyin/reservation/douyin_reservation_handler.py b/douyin/reservation/douyin_reservation_handler.py index 108d242..7a76016 100644 --- a/douyin/reservation/douyin_reservation_handler.py +++ b/douyin/reservation/douyin_reservation_handler.py @@ -925,7 +925,9 @@ def _dump_room_pos_map_to_state(analyser: Any) -> None: with open(csv_tmp, "w", encoding="utf-8", newline="") as cf: writer = csv.writer(cf) writer.writerow(["pos", "title", "title_raw"]) - for k in sorted(filtered.keys(), key=lambda x: int(x) if x.isdigit() else x): + for k in sorted( + filtered.keys(), key=lambda x: int(x) if x.isdigit() else x + ): v = filtered.get(k, ["", ""]) or ["", ""] writer.writerow([k, v[0], v[1]]) try: @@ -938,7 +940,9 @@ def _dump_room_pos_map_to_state(analyser: Any) -> None: mf.write(f"\n\n") mf.write("| 位置 | 标题 | 原始标题 |\n") mf.write("|-:|:-|:-|\n") - for k in sorted(filtered.keys(), key=lambda x: int(x) if x.isdigit() else x): + for k in sorted( + filtered.keys(), key=lambda x: int(x) if x.isdigit() else x + ): v = filtered.get(k, ["", ""]) or ["", ""] title = v[0].replace("|", "\\|") title_raw = v[1].replace("|", "\\|") diff --git a/gui/gui_app.py b/gui/gui_app.py index a612be5..64162ec 100644 --- a/gui/gui_app.py +++ b/gui/gui_app.py @@ -426,11 +426,19 @@ def main(): import path_config as _pc candidates = [ - os.path.join(_pc.PROJECT_ROOT, "douyin", "core", "state", "room_pos_map.json"), - os.path.join(os.getcwd(), "douyin", "core", "state", "room_pos_map.json"), + os.path.join( + _pc.PROJECT_ROOT, "douyin", "core", "state", "room_pos_map.json" + ), + os.path.join( + os.getcwd(), "douyin", "core", "state", "room_pos_map.json" + ), ] except Exception: - candidates = [os.path.join(os.getcwd(), "douyin", "core", "state", "room_pos_map.json")] + candidates = [ + os.path.join( + os.getcwd(), "douyin", "core", "state", "room_pos_map.json" + ) + ] for p in candidates: try: if os.path.exists(p): @@ -458,7 +466,10 @@ def main(): mapping_tree.delete(*mapping_tree.get_children()) try: - keys = sorted([k for k in data.keys()], key=lambda x: int(x) if str(x).isdigit() else x) + keys = sorted( + [k for k in data.keys()], + key=lambda x: int(x) if str(x).isdigit() else x, + ) except Exception: keys = list(data.keys()) @@ -2839,14 +2850,19 @@ def main(): if not parsed: # 非JSON或解析错误:在表格中显示原始文本的一行提示 - mapping_tree.insert("", "end", values=("-", "(非JSON,查看原始文件)", "")) + mapping_tree.insert( + "", "end", values=("-", "(非JSON,查看原始文件)", "") + ) else: # 移除元信息 if isinstance(parsed, dict) and "_meta" in parsed: parsed.pop("_meta", None) # 按数字顺序插入 try: - keys = sorted(parsed.keys(), key=lambda x: int(x) if str(x).isdigit() else x) + keys = sorted( + parsed.keys(), + key=lambda x: int(x) if str(x).isdigit() else x, + ) except Exception: keys = list(parsed.keys()) for k in keys: