|
14 | 14 | # North American countries. |
15 | 15 | NA_COUNTRIES: Tuple[str] = ("CA", "US") |
16 | 16 | NA_INDEX_NAMES: Dict[str, str] = { |
17 | | - "CA": "noa_aem_game_en_ca", |
18 | | - "US": "noa_aem_game_en_us", |
| 17 | + "CA": "ncom_game_en_ca", |
| 18 | + "US": "ncom_game_en_us", |
19 | 19 | } |
20 | 20 |
|
21 | 21 | # Mapping of country code to language code. NOTE: language must be lowercase |
@@ -64,11 +64,11 @@ class Country(enum.Enum): |
64 | 64 |
|
65 | 65 | # Below constants used by North America (US and CA) |
66 | 66 | APP_ID = "U3B6GR4UA3" |
67 | | -API_KEY = "9a20c93440cf63cf1a7008d75f7438bf" |
| 67 | +API_KEY = "c4da8be7fd29f0f5bfa42920b0a99dc7" |
68 | 68 | QUERIES = [ |
69 | 69 | { |
70 | | - "indexName": "noa_aem_game_en_us", |
71 | | - "params": "query=&hitsPerPage=350&maxValuesPerFacet=30&facets=%5B%22generalFilters%22%2C%22platform%22%2C%22availability%22%2C%22categories%22%2C%22filterShops%22%2C%22virtualConsole%22%2C%22characters%22%2C%22priceRange%22%2C%22esrb%22%2C%22filterPlayers%22%5D&tagFilters=&facetFilters=%5B%5B%22generalFilters%3ADeals%22%5D%2C%5B%22platform%3ANintendo%20Switch%22%5D%5D", # noqa |
| 70 | + "indexName": "ncom_game_en_us", |
| 71 | + "params": "query=&hitsPerPage=350&maxValuesPerFacet=30&page=0&analytics=false&facets=%5B%22generalFilters%22%2C%22platform%22%2C%22availability%22%2C%22genres%22%2C%22howToShop%22%2C%22virtualConsole%22%2C%22franchises%22%2C%22priceRange%22%2C%22esrbRating%22%2C%22playerFilters%22%5D&tagFilters=&facetFilters=%5B%5B%22platform%3ANintendo%20Switch%22%5D%2C%5B%22generalFilters%3ADeals%22%5D%5D", # noqa |
72 | 72 | }, |
73 | 73 | ] |
74 | 74 |
|
@@ -105,7 +105,7 @@ async def fetch_on_sale(self) -> Dict[int, SwitchGame]: |
105 | 105 |
|
106 | 106 | def get_na_switch_game(self, game: Dict[str, Any]) -> SwitchGame: |
107 | 107 | """Get a SwitchGame from a json result.""" |
108 | | - box_art = game.get("boxArt", game.get("gallery")) |
| 108 | + box_art = game.get("boxart", game.get("gallery")) |
109 | 109 | if not box_art or not box_art.endswith((".png", ".jpg")): |
110 | 110 | raise ValueError("Couldn't find box art: %s", game) |
111 | 111 |
|
@@ -133,7 +133,7 @@ async def _get_page( |
133 | 133 | queries[0]["params"] = query_params |
134 | 134 | data = await client.multiple_queries_async(queries) |
135 | 135 | # Filter out resuls w/o box art. |
136 | | - games = [r for r in data["results"][0]["hits"] if r.get("boxArt")] |
| 136 | + games = [r for r in data["results"][0]["hits"] if r.get("boxart")] |
137 | 137 | result["games"] = self.filter_wishlist_matches(games) |
138 | 138 | result["num_pages"] = data["results"][0]["nbPages"] |
139 | 139 | return result |
|
0 commit comments