From ba50d9923455543aecf73af8141f199205127eda Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 5 Jun 2022 17:11:34 +0200 Subject: Ability to scrape boards from certain scoring group in TC --- boards/scrapers/tournamentcalculator/scrape.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'boards/scrapers/tournamentcalculator/scrape.py') diff --git a/boards/scrapers/tournamentcalculator/scrape.py b/boards/scrapers/tournamentcalculator/scrape.py index d82c778..fcdd8b8 100644 --- a/boards/scrapers/tournamentcalculator/scrape.py +++ b/boards/scrapers/tournamentcalculator/scrape.py @@ -7,6 +7,7 @@ from urllib import parse results_url = parse.urlparse(sys.argv[1]) tournament_name = results_url.path.strip('/').split('/')[-1] +scoring_group = int(sys.argv[2]) if len(sys.argv) > 2 else 1 def get_json_content(remote_path): @@ -22,7 +23,7 @@ current_board_set = [] prev_board_number = 0 for board in sorted(board_numbers): - board_data = get_json_content('p%d.json' % board)['ScoringGroups'][0]['Distribution'] + board_data = get_json_content('p%d.json' % board)['ScoringGroups'][scoring_group-1]['Distribution'] if board_data['_numberAsPlayed'] < prev_board_number: board_sets.append(current_board_set) current_board_set = [] -- cgit v1.2.3