diff --git a/check_cards.py b/check_cards.py index 05c0e0a..c6ae7cd 100644 --- a/check_cards.py +++ b/check_cards.py @@ -49,10 +49,10 @@ async def main(args): pass elif 'batting' in x['image'] and 'skip_bats' in arg_data and arg_data['skip_bats'].lower() == 'true': pass - elif 'sombaseball' in x['image']: - errors.append((x, f'Bad card url: {x["image"]}')) elif 'start_id' in arg_data and int(arg_data['start_id']) > x['player_id']: pass + elif 'sombaseball' in x['image']: + errors.append((x, f'Bad card url: {x["image"]}')) else: count += 1 if count % 20 == 0: @@ -90,21 +90,24 @@ async def main(args): else: card_url = x['image2'] - try: - resp = await url_get(card_url, timeout=6) - - except ConnectionError as e: - if cxn_error: - raise e - - cxn_error = True - errors.append((x, e)) - - except ValueError as e: - errors.append((x, e)) - + if 'sombaseball' in x['image2']: + errors.append((x, f'Bad card url: {x["image"]}')) else: - successes.pop(x) + try: + resp = await url_get(card_url, timeout=6) + + except ConnectionError as e: + if cxn_error: + raise e + + cxn_error = True + errors.append((x, e)) + + except ValueError as e: + errors.append((x, e)) + + else: + successes.pop(x) if len(errors) > 0: logging.error(f'All Errors:')