Failed to get trophies for game I played #36
-
Hello, first of all thank you for this very nice work! Here is the code: from psnawp_api import PSNAWP
# got from https://ca.account.sony.com/api/v1/ssocookie
psnawp = PSNAWP('<npsso-code>')
client = psnawp.me()
print(client.online_id)
print(client.account_id)
earned_trophies = client.trophy_summary().earned_trophies
print(earned_trophies)
print()
for trophy_title in client.trophy_titles(limit=1):
print("Last trophy earned:")
last_trophy_game_name = trophy_title.title_name
print(f"last_trophy_game_name = {last_trophy_game_name}")
print(trophy_title.last_updated_date_time)
print()
list_of_game = ['PPSA01411_00', 'PPSA01417_00', 'PPSA01418_00', 'PPSA01419_00', 'PPSA01460_00', 'PPSA01461_00' ]
for game in list_of_game:
game_title = psnawp.game_title(game, 'me')
trophy_groups_summary = game_title.trophy_groups_summary(platform = 'PS5')
print(trophy_groups_summary.trophy_title_name)
print(trophy_groups_summary.hidden_flag)
trophy_set = trophy_groups_summary.earned_trophies
print(trophy_set)
game_title = psnawp.game_title(game, client.account_id)
trophy_groups_summary = game_title.trophy_groups_summary(platform = 'PS5')
print(trophy_groups_summary.hidden_flag)
trophy_set = trophy_groups_summary.earned_trophies
print(trophy_set) Here is the result:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try using this method here. You can use this website to get the title id. If you live in America, then you only need the UP region. If you want to search for the trophies you have earned, use the client class methods If you want to check the trophies others have earned, use the user class methods. The game title class is there for checking what trophies you can earn for a video game. This won't contain the stats related to the earned trophies. |
Beta Was this translation helpful? Give feedback.
Try using this method here.
https://psnawp.readthedocs.io/en/latest/psnawp_api.models.html#psnawp_api.models.client.Client.trophy_groups_summary
You can use this website to get the title id. If you live in America, then you only need the UP region.
If you want to search for the trophies you have earned, use the client class methods
If you want to check the trophies others have earned, use the user class methods.
The game title class is there for checking what trophies you can earn for a video game. This won't contain the stats related to the earned trophies.