aboutsummaryrefslogtreecommitdiffstats
path: root/sega
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-10-16 12:46:39 -0700
committerPinapelz <yukais@pinapelz.com>2025-10-16 12:49:53 -0700
commit3304087317bae4fa7e336d731879335619d314e9 (patch)
tree6e8150c208cd142bca0efb7f1b313baa4502e515 /sega
parent4dddacb59dc7569514f8bce1fad5b44026eca8a9 (diff)
fix: maimaidx_intl image urls wrong datepath
Diffstat (limited to 'sega')
-rw-r--r--sega/maimaidx_intl.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/sega/maimaidx_intl.py b/sega/maimaidx_intl.py
index 82fea6f..3e26a37 100644
--- a/sega/maimaidx_intl.py
+++ b/sega/maimaidx_intl.py
@@ -54,13 +54,17 @@ def parse_maimaidx_intl_api_route(raw_api_data: str, identifier: str, limit: int
route_data = route_data[:limit]
entries = []
for post_data in route_data:
- date_data = post_data["date"]
- date_str = ".".join([str(x) for x in date_data[:3]]) # YYYY.MM.DD
+ date_data = [str(x) for x in post_data["date"]]
+ date_str = ".".join(date_data[:3]) # YYYY.MM.DD
+ if len(date_data) == 4:
+ image_route = f"{date_data[0]}-{date_data[1].zfill(2)}-{date_data[2].zfill(2)}-{date_data[3]}"
+ else:
+ image_route = f"{date_data[0]}-{date_data[1].zfill(2)}-{date_data[2].zfill(2)}"
dt = datetime.strptime(date_str, "%Y.%m.%d").replace(tzinfo=timezone(timedelta(hours=9)))
timestamp = int(dt.timestamp())
- full_image_url = f"https://maimai.sega.com/assets/img/download/pop/download/{date_data[0]}-{date_data[1]}-{date_data[2]}/{post_data['thumb']}"
+ full_image_url = f"https://maimai.sega.com/assets/img/download/pop/download/{image_route}/{post_data['thumb']}"
if len(date_data) == 4:
- full_image_url = f"https://maimai.sega.com/assets/img/download/pop/download/{date_data[0]}-{date_data[1]}-{date_data[2]}-{date_data[3]}/{post_data['thumb']}"
+ full_image_url = f"https://maimai.sega.com/assets/img/download/pop/download/{image_route}/{post_data['thumb']}"
content = post_data["desc"] + f"\n\nNew maimai DX International News / maimai DX International の新しいお知らせ\n\n{full_image_url}"
headline = post_data["title"]
images = [{
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage