all
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import requests
|
||||
|
||||
# Steam-API-Einheitspunkt
|
||||
STEAM_API_URL = "https://api.steampowered.com"
|
||||
|
||||
# Benutzer-ID oder Anwendung-ID
|
||||
USER_ID = "656119799984" # ersetzen Sie mit der ID des Benutzers oder der Anwendung, für die Sie Informationen benötigen
|
||||
|
||||
def get_user_info(user_id):
|
||||
"""
|
||||
Ruft die Information über einen bestimmten Benutzer ab.
|
||||
"""
|
||||
url = f"{STEAM_API_URL}/ISteamUser/GetPlayerSummarInfo/v0001/?key=80BED3ACB9E38E5A944F2BEB26FC9C3E&steamids={user_id}"
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
data = response.text
|
||||
return data
|
||||
else:
|
||||
print(f"Ein Fehler auftrat: {response.status_code}")
|
||||
return None
|
||||
|
||||
def get_app_info(app_id):
|
||||
"""
|
||||
Ruft die Information über eine bestimmte Anwendung ab.
|
||||
"""
|
||||
url = f"{STEAM_API_URL}/ISteamApp/GetAppList/v0001/?key=80BED3ACB9E38E5A944F2BEB26FC9C3E&appids={app_id}"
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
data = response.text
|
||||
return data
|
||||
else:
|
||||
print(f"Ein Fehler auftrat: {response.status_code}")
|
||||
return None
|
||||
|
||||
def main():
|
||||
user_info = get_user_info(USER_ID)
|
||||
print("Benutzer-Informationen:")
|
||||
for line in user_info.splitlines():
|
||||
print(line)
|
||||
|
||||
app_info = get_app_info(USER_ID) # oder USER_ID
|
||||
print("\nAnwendung-Informationen:")
|
||||
lines = app_info.splitlines()
|
||||
while lines:
|
||||
line = lines.pop(0)
|
||||
if line.startswith("<"):
|
||||
break
|
||||
print(line)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user