Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Record Cards API URL Change #204

Closed
KT-Yeh opened this issue Jul 6, 2024 · 2 comments · Fixed by #205
Closed

Game Record Cards API URL Change #204

KT-Yeh opened this issue Jul 6, 2024 · 2 comments · Fixed by #205
Labels
bug Something isn't working

Comments

@KT-Yeh
Copy link
Collaborator

KT-Yeh commented Jul 6, 2024

Code

client = genshin.Client(cookie, lang="zh-tw", debug=True, region=genshin.types.Region.OVERSEAS)
client.default_game = genshin.Game.STARRAIL
await client.get_record_cards()

Error:

DEBUG:genshin.client.components.base:GET https://bbs-api-os.hoyolab.com/game_record/hkrpg/api/card/wapi/getGameRecordCard?uid=111141315

GenshinException: Recieved a response with an invalid content type:
404 page not found

Old url: https://bbs-api-os.hoyolab.com/game_record/hkrpg/api/card/wapi/getGameRecordCard?uid=111141315

New url: https://bbs-api-os.hoyolab.com/game_record/card/wapi/getGameRecordCard?uid=111141315

And every game use the same record card url.

The new response content:

{
    "retcode": 0,
    "message": "OK",
    "data": {
        "list": [
            {
                "has_role": true,
                "game_id": 2,
                "game_role_id": "826263929",
                "nickname": "KT",
                "region": "os_asia",
                "level": 60,
                "background_image": "https://upload-os-bbs.hoyolab.com/game_record/game_record_ys_background.png",
                "is_public": true,
                "data": [
                    {
                        "name": "Days Active",
                        "type": 1,
                        "value": "1068"
                    },
                    {
                        "name": "Characters",
                        "type": 1,
                        "value": "59"
                    },
                    {
                        "name": "Achievements",
                        "type": 1,
                        "value": "1009"
                    },
                    {
                        "name": "Spiral Abyss",
                        "type": 1,
                        "value": "12-3"
                    }
                ],
                "region_name": "Asia Server",
                "url": "https://act.hoyolab.com/app/community-game-records-sea/m.html?bbs_presentation_style=fullscreen\u0026bbs_auth_required=true\u0026gid=2\u0026user_id=111141315\u0026utm_source=hoyolab\u0026utm_medium=gamecard",
                "data_switches": [
                    {
                        "switch_id": 1,
                        "is_public": true,
                        "switch_name": "Show my Battle Chronicle on my profile"
                    },
                    {
                        "switch_id": 2,
                        "is_public": true,
                        "switch_name": "Show your Character Details in the Battle Chronicle?"
                    },
                    {
                        "switch_id": 3,
                        "is_public": true,
                        "switch_name": "Do you want to enable your \"Real-Time Notes\" to view your in-game data?"
                    }
                ],
                "h5_data_switches": [],
                "background_color": "D3BC8E",
                "background_image_v2": "",
                "logo": "https://fastcdn.hoyoverse.com/static-resource-v2/2024/04/12/b700cce2ac4c68a520b15cafa86a03f0_2812765778371293568.png",
                "game_name": "Genshin Impact"
            },
            {
                "has_role": true,
                "game_id": 6,
                "game_role_id": "802201214",
                "nickname": "KT",
                "region": "prod_official_asia",
                "level": 70,
                "background_image": "https://upload-os-bbs.hoyolab.com/game_record/rpg_card.png",
                "is_public": false,
                "data": [
                    {
                        "name": "Time Active",
                        "type": 1,
                        "value": "434"
                    },
                    {
                        "name": "Characters Unlocked",
                        "type": 1,
                        "value": "38"
                    },
                    {
                        "name": "Achievements Unlocked",
                        "type": 1,
                        "value": "496"
                    },
                    {
                        "name": "Treasures Opened",
                        "type": 1,
                        "value": "644"
                    }
                ],
                "region_name": "Asia Server",
                "url": "https://act.hoyolab.com/app/community-game-records-sea/rpg/m.html?bbs_presentation_style=fullscreen\u0026gid=6\u0026user_id=111141315\u0026utm_source=hoyolab\u0026utm_medium=gamecard#/hsr",
                "data_switches": [
                    {
                        "switch_id": 1,
                        "is_public": false,
                        "switch_name": "Show my Battle Chronicle on my profile"
                    },
                    {
                        "switch_id": 4,
                        "is_public": false,
                        "switch_name": "Show your Character Details in the Battle Chronicle?"
                    }
                ],
                "h5_data_switches": [],
                "background_color": "FFC870",
                "background_image_v2": "",
                "logo": "https://fastcdn.hoyoverse.com/static-resource-v2/2024/04/12/74330de1ee71ada37bbba7b72775c9d3_1883015313866544428.png",
                "game_name": "Honkai: Star Rail"
            },
            {
                "has_role": true,
                "game_id": 8,
                "game_role_id": "1300012210",
                "nickname": "KT",
                "region": "prod_gf_jp",
                "level": 6,
                "background_image": "",
                "is_public": false,
                "data": [
                    {
                        "name": "Days Active",
                        "type": 1,
                        "value": "1"
                    },
                    {
                        "name": "Inter-Knot Reputation",
                        "type": 1,
                        "value": "Novice Proxy"
                    },
                    {
                        "name": "Agents Recruited",
                        "type": 1,
                        "value": "5"
                    },
                    {
                        "name": "Bangboo Obtained",
                        "type": 1,
                        "value": "0"
                    }
                ],
                "region_name": "Asia",
                "url": "https://act.hoyolab.com/app/mihoyo-zzz-game-record/m.html?hyl_presentation_style=fullscreen\u0026bbs_auth_required=true\u0026game_id=8\u0026user_id=111141315",
                "data_switches": [
                    {
                        "switch_id": 1,
                        "is_public": false,
                        "switch_name": "Show my Battle Chronicle on my profile"
                    },
                    {
                        "switch_id": 6,
                        "is_public": true,
                        "switch_name": "Show your Character Details in the Battle Chronicle?"
                    },
                    {
                        "switch_id": 7,
                        "is_public": true,
                        "switch_name": "Do you want to enable your \"Real-Time Notes\" to view your in-game data?"
                    }
                ],
                "h5_data_switches": [],
                "background_color": "ffc22b",
                "background_image_v2": "",
                "logo": "https://fastcdn.hoyoverse.com/static-resource-v2/2024/05/20/3c251a9972cde4858b8f122e1a353b50_5932843772477377751.png",
                "game_name": "Zenless Zone Zero"
            }
        ]
    }
}
@KT-Yeh KT-Yeh added the bug Something isn't working label Jul 6, 2024
@seriaati
Copy link
Collaborator

seriaati commented Jul 6, 2024

What we want
image

@seriaati
Copy link
Collaborator

seriaati commented Jul 7, 2024

I'm unable to reproduce your error, it is requesting https://bbs-api-os.hoyolab.com/game_record/card/wapi/getGameRecordCard for me, I am on genshin.py master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants