-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend_steamspy.py
165 lines (148 loc) · 5.62 KB
/
extend_steamspy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import steampi.calendar
import steamspypi.api
from my_types import HardCodedIDs
YEAR_LENGTH = len("2025")
def get_hard_coded_steamspy_database_extension() -> HardCodedIDs:
# Entries manually added to SteamSpy's database
return {
# Dummy (negative) Steam appIDs for games absent from Steam, e.g. console games or PC games from other stores.
"-1": {
"name": "Marvel's Spider-Man",
"developer": "Insomniac Games",
"publisher": "Sony Interactive Entertainment",
},
"-2": {
"name": "Fallout 76",
"developer": "Bethesda Game Studios",
"publisher": "Bethesda Softworks",
},
"-3": {
"name": "Ashen",
"developer": "New Zealand studio A44",
"publisher": "Annapurna Interactive",
},
"-4": {
"name": "Deltarune - Chapter 1",
"developer": "Toby Fox",
"publisher": "Toby Fox",
},
"-5": {
"name": "Hades",
"developer": "Supergiant Games",
"publisher": "Supergiant Games",
},
"-6": {
"name": "Un Pueblo De Nada",
"developer": "Cardboard Computer",
"publisher": "Cardboard Computer",
},
"-7": {
"name": "Phoenix Point",
"developer": "Snapshot Games",
"publisher": "Snapshot Games",
},
# Dummy (negative) Steam appIDs for DLC/major updates absent from Steam.
"-101": {
"name": "Warframe: Fortuna - Orb Vallis map",
"developer": "Digital Extremes",
"publisher": "Digital Extremes",
},
"-102": {
"name": "Counter-Strike: Global Offensive (Danger Zone)",
"developer": "Valve, Hidden Path Entertainment",
"publisher": "Valve",
},
"-103": {
"name": "Path of Exile: Betrayal",
"developer": "Grinding Gear Games",
"publisher": "Grinding Gear Games",
},
# Dummy (negative) Steam appIDs for softwares absent from Steam.
"-201": {
"name": "Epic Games Launcher (software)",
"developer": "Epic Games",
"publisher": "Epic Games",
},
# Legitimate Steam appIDs for adult Steam games, which are not provided by SteamSpy as they are tagged as adult.
"885940": {
"name": "Meritocracy of the Oni & Blade",
"developer": "ONEONE1",
"publisher": "DLsite",
},
"955560": {
"name": "Evenicle",
"developer": "Alicesoft",
"publisher": "MangaGamer",
},
# Legitimate Steam appIDs for Steam games, which are not provided by SteamSpy due to being temporarily removed
"271260": {
"name": "Star Control®: Origins",
"developer": "Stardock Entertainment",
"publisher": "Stardock Entertainment",
},
# Legitimate Steam appIDs for Steam DLC, which are not provided by SteamSpy because they are not games.
"624621": {
"name": "Wolfenstein II: The Freedom Chronicles - Episode 2",
},
"662351": {
"name": "Assassin's Creed® Origins - The Curse Of The Pharaohs",
},
"744840": {
"name": "Rainbow Six Siege - Year 3 Pass",
},
"785300": {
"name": "XCOM 2: War of the Chosen - Tactical Legacy Pack",
},
"792331": {
"name": "Valkyria Chronicles 4 - Squad E, to the Beach!",
},
"865670": {
"name": "Prey - Mooncrash",
},
"874344": {
"name": "SOULCALIBUR VI - 2B",
},
"896680": {
"name": "WORLD OF FINAL FANTASY® MAXIMA Upgrade",
},
"911930": {
"name": "BATTLETECH Flashpoint",
},
"947950": {
"name": "Faeria - Puzzle Pack Elements",
},
"984180": {
"name": "Pinball FX3 - Williams™ Pinball: Volume 2",
},
}
def load_extended_steamspy_database(steamspy_database: dict | None = None) -> dict:
if steamspy_database is None:
steamspy_database = steamspypi.load()
hard_coded_steamspy_database_extension = (
get_hard_coded_steamspy_database_extension()
)
extended_steamspy_database = steamspy_database
for app_id in hard_coded_steamspy_database_extension:
if app_id in steamspy_database:
print(
f"AppID {app_id} already exists in SteamSpy database. The entry will be overwritten.",
)
extended_steamspy_database[app_id] = hard_coded_steamspy_database_extension[
app_id
]
extended_steamspy_database[app_id]["appid"] = int(app_id)
return extended_steamspy_database
def get_app_name_for_problematic_app_id(app_id: str | None = None) -> str:
return "[Not Available]" if app_id is None else f"app_{app_id}"
def get_release_year_for_problematic_app_id(app_id: str) -> int:
# As of December 2020, SteamSpy returns release_date_as_str = "29 янв. 2015" for appID = "319630".
release_date_as_str = steampi.calendar.get_release_date_as_str(app_id=app_id)
matched_release_year = release_date_as_str.split(" ")[-1]
try:
matched_release_year_as_int = int(matched_release_year[:YEAR_LENGTH])
except ValueError:
matched_release_year = release_date_as_str.split(" ")[0]
matched_release_year_as_int = int(matched_release_year)
return matched_release_year_as_int
if __name__ == "__main__":
steamspy_database = load_extended_steamspy_database()