We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32a509f + 74ed339 commit 95a7b1eCopy full SHA for 95a7b1e
examples/free_games_example.py
@@ -18,7 +18,11 @@ def main() -> None:
18
for game in free_games:
19
game_title = game['title']
20
game_publisher = game['seller']['name']
21
- game_url = f"https://store.epicgames.com/fr/p/{game['catalogNs']['mappings'][0]['pageSlug']}"
+
22
+ url_type = "bundles" if game['offerType'] == "BUNDLE" else "p"
23
+ final_slug = game["catalogNs"]["mappings"][0]["pageSlug"] if game["catalogNs"]["mappings"] else game["urlSlug"]
24
+ game_url = f"https://store.epicgames.com/fr/{url_type}/{final_slug}"
25
26
# Can be useful when you need to also show the thumbnail of the game.
27
# Like in Discord's embeds for example, or anything else.
28
# Here I showed it just as example and won't use it.
0 commit comments