You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My problem is that no matter what I do, I'm getting this error:
Traceback (most recent call last):
File "clientTest.py", line 8, in <module>
res = requests.get('https://127.0.0.1:52351/lol-champ-select/v1/session', headers=headers)
File "C:\Users\Dimitrie\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\Dimitrie\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Dimitrie\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Dimitrie\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Dimitrie\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='127.0.0.1', port=52351): Max retries exceeded with url: /lol-champ-select/v1/session (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))
Clearly I'm doing something wrong, however I'm not quite sure what the problem is. It sounds like there is something wrong with my authentication token I copied and pasted out of Rift Explorer. However, I'm not really sure what the role of this token is considering everything is handled over localhost. I'm also not sure how to acquire this token. Could anyone offer some help?
Edit: Okay, so it turns out my problem was SSL verification built into python's requests library. I fixed it by changing the request line to this: res = requests.get('https://127.0.0.1:52351/lol-champ-select/v1/session', headers=headers, verify=False)
However, I still have no idea how to get my Authorization key and the randomized port after the client starts. How do I do that?
Edit 2:
Wow so this was absurdly complicated to figure out. Doesn't help that there is no documentation anywhere. Here's how I solved it:
When the League Client starts, a file called "lockfile" is generated in the League of Legends install directory. The file looks something like this:
In my case, 52351 is the port. To find the authentication token, you must take "x0UnkskpS3IIZNGzMYZiSg" and concatenate it with "riot:" with the riot part first. Like this:
"riot:x0UnkskpS3IIZNGzMYZiSg"
You then need to take this string and encode it. Then you must take that encoding and turn it into base 64 as a string. That finally is your authentication token. This is the code I used to compute it in python.
Your first error has nothing to do with the edit you added.
The first error is happening because the certificate is self-signed and python can't validate it (as the error message suggests). I solved it in Rift Explorer with this
Thanks for the response and an even bigger thanks for Rift Explorer. It's really nice to have such a convenient way to explore the relatively undocumented Client API.
I currently have this code:
My problem is that no matter what I do, I'm getting this error:
Clearly I'm doing something wrong, however I'm not quite sure what the problem is. It sounds like there is something wrong with my authentication token I copied and pasted out of Rift Explorer. However, I'm not really sure what the role of this token is considering everything is handled over localhost. I'm also not sure how to acquire this token. Could anyone offer some help?
Edit: Okay, so it turns out my problem was SSL verification built into python's requests library. I fixed it by changing the request line to this:
res = requests.get('https://127.0.0.1:52351/lol-champ-select/v1/session', headers=headers, verify=False)
However, I still have no idea how to get my Authorization key and the randomized port after the client starts. How do I do that?
Edit 2:
Wow so this was absurdly complicated to figure out. Doesn't help that there is no documentation anywhere. Here's how I solved it:
When the League Client starts, a file called "lockfile" is generated in the League of Legends install directory. The file looks something like this:
In my case, 52351 is the port. To find the authentication token, you must take "x0UnkskpS3IIZNGzMYZiSg" and concatenate it with "riot:" with the riot part first. Like this:
You then need to take this string and encode it. Then you must take that encoding and turn it into base 64 as a string. That finally is your authentication token. This is the code I used to compute it in python.
I hope this helps someone else because it took me a good few hours of struggling.
The text was updated successfully, but these errors were encountered: