-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65ff27b
commit 05d889c
Showing
14 changed files
with
1,968 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import asyncio | ||
import aiohttp | ||
import urllib.parse | ||
|
||
class Cookie: | ||
sid: str | ||
remid: str | ||
|
||
async def getBf2042GatewaySession(cookie: Cookie): | ||
async with aiohttp.ClientSession() as session: | ||
url = "https://accounts.ea.com/connect/auth?client_id=KINGSTON_COMP_APP&locale=en_US&redirect_uri=https%3A%2F%2Fportal.battlefield.com%2F&response_type=code" | ||
headers = { | ||
"Cookie": f"sid={cookie.sid}; remid={cookie.remid};" | ||
} | ||
async with session.get(url=url, headers=headers, allow_redirects=False) as r: | ||
redirect = r.headers["Location"] | ||
access_code = urllib.parse.urlparse( | ||
redirect).query.split("=")[1] | ||
return access_code | ||
|
||
if __name__ == "__main__": | ||
asyncio.run(getBf2042GatewaySession()) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
"""Client and server classes corresponding to protobuf-defined services.""" | ||
import grpc | ||
|
||
from proto import authentication_pb2 as proto_dot_authentication__pb2 | ||
|
||
|
||
class ClientAuthenticationStub(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def __init__(self, channel): | ||
"""Constructor. | ||
Args: | ||
channel: A grpc.Channel. | ||
""" | ||
self.viaAuthCode = channel.unary_unary( | ||
'/web.authentication.ClientAuthentication/viaAuthCode', | ||
request_serializer=proto_dot_authentication__pb2.AuthRequest.SerializeToString, | ||
response_deserializer=proto_dot_authentication__pb2.AuthResponse.FromString, | ||
) | ||
self.logout = channel.unary_unary( | ||
'/web.authentication.ClientAuthentication/logout', | ||
request_serializer=proto_dot_authentication__pb2.Empty.SerializeToString, | ||
response_deserializer=proto_dot_authentication__pb2.Empty.FromString, | ||
) | ||
|
||
|
||
class ClientAuthenticationServicer(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def viaAuthCode(self, request, context): | ||
"""Missing associated documentation comment in .proto file.""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def logout(self, request, context): | ||
"""Missing associated documentation comment in .proto file.""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
|
||
def add_ClientAuthenticationServicer_to_server(servicer, server): | ||
rpc_method_handlers = { | ||
'viaAuthCode': grpc.unary_unary_rpc_method_handler( | ||
servicer.viaAuthCode, | ||
request_deserializer=proto_dot_authentication__pb2.AuthRequest.FromString, | ||
response_serializer=proto_dot_authentication__pb2.AuthResponse.SerializeToString, | ||
), | ||
'logout': grpc.unary_unary_rpc_method_handler( | ||
servicer.logout, | ||
request_deserializer=proto_dot_authentication__pb2.Empty.FromString, | ||
response_serializer=proto_dot_authentication__pb2.Empty.SerializeToString, | ||
), | ||
} | ||
generic_handler = grpc.method_handlers_generic_handler( | ||
'web.authentication.ClientAuthentication', rpc_method_handlers) | ||
server.add_generic_rpc_handlers((generic_handler,)) | ||
|
||
|
||
# This class is part of an EXPERIMENTAL API. | ||
class ClientAuthentication(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
@staticmethod | ||
def viaAuthCode(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/web.authentication.ClientAuthentication/viaAuthCode', | ||
proto_dot_authentication__pb2.AuthRequest.SerializeToString, | ||
proto_dot_authentication__pb2.AuthResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
||
@staticmethod | ||
def logout(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/web.authentication.ClientAuthentication/logout', | ||
proto_dot_authentication__pb2.Empty.SerializeToString, | ||
proto_dot_authentication__pb2.Empty.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.