From 8bebc00a313f869917ef5fedd1d7c1060939a537 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:06:20 +0800 Subject: [PATCH] Fix: Parsing season pass remain in hours --- tasks/login/cloud.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/login/cloud.py b/tasks/login/cloud.py index 11d0f62cc..7ef05b431 100644 --- a/tasks/login/cloud.py +++ b/tasks/login/cloud.py @@ -159,6 +159,16 @@ class LoginAndroidCloud(ModuleBase): season_pass = int(res.group(1)) else: season_pass = 0 + # 42 天 + # 5 小时 + if '天' in text: + pass + elif '小时' in text: + season_pass = round(season_pass / 24, 2) + elif '分钟' in text: + season_pass = round(season_pass / 24 / 60, 3) + else: + logger.error(f'Unexpected season pass text: {text}') text = self.xpath(XPath.REMAIN_PAID).text logger.info(f'Remain paid: {text}')