ezKit 2.0.24__tar.gz → 2.0.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ezkit-2.0.24/ezKit.egg-info → ezkit-2.0.26}/PKG-INFO +1 -1
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/bandwagon.py +10 -1
- {ezkit-2.0.24 → ezkit-2.0.26/ezKit.egg-info}/PKG-INFO +1 -1
- {ezkit-2.0.24 → ezkit-2.0.26}/setup.py +1 -1
- {ezkit-2.0.24 → ezkit-2.0.26}/LICENSE +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/MANIFEST.in +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/README.md +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/__init__.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/__zabbix.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/asyncdatabase.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/cipher.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/database.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/errorcode.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/fastapix.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/http.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/redix.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/sendemail.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/stock.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit/utils.py +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit.egg-info/SOURCES.txt +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit.egg-info/dependency_links.txt +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit.egg-info/requires.txt +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/ezKit.egg-info/top_level.txt +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/pyproject.toml +0 -0
- {ezkit-2.0.24 → ezkit-2.0.26}/setup.cfg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
+
from datetime import datetime, timedelta, timezone
|
|
4
5
|
from typing import Any
|
|
5
6
|
|
|
6
7
|
import requests
|
|
@@ -93,4 +94,12 @@ def format_bandwidth(info: dict) -> str:
|
|
|
93
94
|
# 使用率
|
|
94
95
|
usage = (info["data_counter"] / info["plan_monthly_data"]) * 100
|
|
95
96
|
|
|
96
|
-
return f"{used:.2f}/{total
|
|
97
|
+
return f"{used:.2f}/{total} GB ({usage:.2f}%)"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def expiration_date(info: dict) -> str:
|
|
101
|
+
# 过期时间
|
|
102
|
+
# 通过 getLiveServiceInfo 获取 data_next_reset 字段 (秒级时间戳)
|
|
103
|
+
# 将时间戳转为 UTC+8 时间
|
|
104
|
+
date = datetime.fromtimestamp(info["data_next_reset"], tz=timezone(timedelta(hours=8))).strftime("%Y-%m-%d")
|
|
105
|
+
return date
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|