diff options
| author | Michał Klichowicz <emkael@tlen.pl> | 2026-09-10 12:57:35 +0200 |
|---|---|---|
| committer | Michał Klichowicz <emkael@tlen.pl> | 2026-09-10 12:57:35 +0200 |
| commit | 13906ea84e04ae3b0e28c4e3576fe93278d7eecb (patch) | |
| tree | 0e12c020e3cf629ead5a9eba7303630e8d637f1e /jfr_playoff/data/tournament/tcjson.py | |
| parent | e539fa58a5329ae0e6c9ccb32e217619a55f3130 (diff) | |
TC JSON files can be served GZIP-ed, support it transparently (as long as remote server sets proper Content-Type headers)gzipped-tcjson
Diffstat (limited to 'jfr_playoff/data/tournament/tcjson.py')
| -rw-r--r-- | jfr_playoff/data/tournament/tcjson.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/jfr_playoff/data/tournament/tcjson.py b/jfr_playoff/data/tournament/tcjson.py index c84c27f..c84a864 100644 --- a/jfr_playoff/data/tournament/tcjson.py +++ b/jfr_playoff/data/tournament/tcjson.py @@ -28,7 +28,10 @@ class TCJsonTournamentInfo(TournamentInfoClient): def is_finished(self): settings_json = json.loads( - p_remote.fetch_raw(self.get_results_link('settings.json'))) + p_remote.fetch_raw( + self.get_results_link('settings.json'), + gzip_fallback=True + )) live_results = settings_json['LiveResults'] last_round = settings_json['LastPlayedRound'] last_session = settings_json['LastPlayedSession'] @@ -42,7 +45,10 @@ class TCJsonTournamentInfo(TournamentInfoClient): def get_tournament_results(self): results = [] results_json = json.loads( - p_remote.fetch_raw(self.get_results_link('results.json'))) + p_remote.fetch_raw( + self.get_results_link('results.json'), + gzip_fallback=True + )) participant_groups = [] for result in results_json['Results']: group = result['ParticipantGroup'] |
