Parcourir la source

holy fuck

master
Victor Fors il y a 2 ans
Parent
révision
e733e5cd0a
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. +5
    -2
      sstatus

+ 5
- 2
sstatus Voir le fichier

@@ -3,7 +3,10 @@ import requests
import sys import sys
import textwrap import textwrap
import pprint import pprint
import simplejson
try:
from simplejson.errors import JSONDecodeError
except ImportError:
from json.decoder import JSONDecodeError


api = 'http://api.steampowered.com/' api = 'http://api.steampowered.com/'
key = '63578AF8E85EDF1E49411D5D4E18E166' key = '63578AF8E85EDF1E49411D5D4E18E166'
@@ -20,7 +23,7 @@ def json_query(url, transform, params={}):
sys.exit(1) sys.exit(1)
try: try:
data = result.json() data = result.json()
except simplejson.errors.JSONDecodeError as err:
except JSONDecodeError as err:
print('Error when decoding JSON:\nFrom endpoint ' + url + ':\n' + str(err) + '\n' + str(result) + '\n') print('Error when decoding JSON:\nFrom endpoint ' + url + ':\n' + str(err) + '\n' + str(result) + '\n')
sys.exit(1) sys.exit(1)
try: try:


Chargement…
Annuler
Enregistrer