colinhartigan / valclient.py

valorant client api wrapper
MIT License
72 stars 17 forks source link

fetch(), contracts_fetch() and fetch_content() returning None #12

Closed theyaoster closed 1 year ago

theyaoster commented 1 year ago

Since VALORANT 6.01, I've been seeing these two client calls returning None. Running the following with the game open

from valclient import Client
import requests

client = Client()
client.activate()

print(client.fetch_content())
print(client.contracts_fetch())

response1 = requests.get(f"https://pd.na.a.pvp.net/contracts/v1/contracts/{client.puuid}", headers=client.headers)
print(response1.text)
response2 = requests.get(f"https://shared.na.a.pvp.net/content-service/v3/content", headers=client.headers)
print(response2.text)

gives

None
None
{"httpStatus":500,"errorCode":"INTERNAL_UNHANDLED_SERVER_ERROR","message":"Unexpected error encountered"}

{"httpStatus":500,"errorCode":"INTERNAL_SERVER_ERROR","message":"Internal error encountered"}

That said, I inspected ShooterGame.log, and it looks like the endpoints and API routes are correct (unlike in a previous issue where the API got bumped from v2 to v3). Moreover, I can see successful calls in the log to these endpoints:

...
[2023.01.19-01.41.38:877][928]LogPlatformCommon: Platform HTTP Query End. QueryName: [Contracts_Fetch], URL [GET https://pd.na.a.pvp.net/contracts/v1/contracts/ac0fd66f-cab6-5079-a4e8-66e9be0742a6], TraceID: [8441B8F442CE3D824F2CBCA41411DABF] Response Code: [200]
...
...
[2023.01.19-01.43.40:043][ 86]LogPlatformCommon: Platform HTTP Query End. QueryName: [Content_FetchContent], URL [GET https://shared.na.a.pvp.net/content-service/v3/content], TraceID: [EF8E97F046669DD978F0F985870C7846] Response Code: [200]
...

So I'm thinking maybe something has changed with the API interaction = maybe additional or different parameters/headers are required. Let me know if you can reproduce this with the latest version of VALORANT.

colinhartigan commented 1 year ago

was a problem with valorant-api.com, and it should be fixed now

theyaoster commented 1 year ago

Confirmed it's working again, thanks - didn't realize we had a dependency on valorant-api.

(For future readers, valorant-api is needed to fill the X-Riot-ClientVersion header. I'm guessing that's what caused the issue.)