tldr.
It says that you are not in a pre-game in pregame_fetch_match while the pregame_fetch_player returns a MatchId. Can you help?
print(self.client.fetch_presence())
print(self.client.pregame_fetch_player())
match_id = self.client.pregame_fetch_player()
match = self.client.pregame_fetch_match(match_id) # The line which triggered the error
{'isValid': True, 'sessionLoopState': 'PREGAME', 'partyOwnerSessionLoopState': 'PREGAME', 'customGameName': '', 'customGameTeam': '', 'partyOwnerMatchMap': '/Game/Maps/Port/Port', 'partyOwnerMatchCurrentTeam': '', 'partyOwnerMatchScoreAllyTeam': 0, 'partyOwnerMatchScoreEnemyTeam': 0, 'partyOwnerProvisioningFlow': 'Matchmaking', 'provisioningFlow': 'Matchmaking', 'matchMap': '/Game/Maps/Port/Port', 'partyId': 'blablabla', 'isPartyOwner': True, 'partyState': 'DEFAULT', 'partyAccessibility': 'CLOSED', 'maxPartySize': 5, 'queueId': 'spikerush', 'partyLFM': False, 'partyClientVersion': 'release-03.08-shipping-5-620887', 'partySize': 1, 'tournamentId': '', 'rosterId': '', 'partyVersion': 1634747847209, 'queueEntryTime': '2021.10.20-16.37.25', 'playerCardId': 'blablabla', 'playerTitleId': 'blablabla', 'preferredLevelBorderId': '', 'accountLevel': 28, 'competitiveTier': 4, 'leaderboardPosition': 0, 'isIdle': False}
{'Subject': 'blablabla', 'MatchID': 'eb6df31c-bf10-4561-8a83-d44db1ebf963', 'Version': 1634747847163}
---------------------------------------------------------------------------
PhaseError Traceback (most recent call last)
C:\Users\REBELL~1\AppData\Local\Temp/ipykernel_12588/4048721659.py in <module>
2
3 program = Program(user_id)
----> 4 program.run()
C:\Users\REBELL~1\AppData\Local\Temp/ipykernel_12588/2252940000.py in run(self)
49 match_id = self.client.pregame_fetch_player()
50 print(match_id)
---> 51 match = self.client.pregame_fetch_match(match_id)
52 print(match)
53
~\Documents\projects\valclient\src\valclient\client.py in pregame_fetch_match(self, match_id)
609 '''
610 match_id = self.__pregame_check_match_id(match_id)
--> 611 data = self.fetch(endpoint=f"/pregame/v1/matches/{match_id}",endpoint_type="glz", exceptions={404: [PhaseError, "You are not in a pre-game"]})
612 return data
613
~\Documents\projects\valclient\src\valclient\client.py in fetch(self, endpoint, endpoint_type, exceptions)
99
100 # custom exceptions for http status codes
--> 101 self.__verify_status_code(response.status_code, exceptions)
102
103 try:
~\Documents\projects\valclient\src\valclient\client.py in __verify_status_code(self, status_code, exceptions)
91 if status_code in exceptions.keys():
92 response_exception = exceptions[status_code]
---> 93 raise response_exception[0](response_exception[1])
94
95 def fetch(self, endpoint="/", endpoint_type="pd", exceptions={}) -> dict: # exception: code: {Exception, Message}
PhaseError: You are not in a pre-game