Skip to content

Commit

Permalink
fix #314
Browse files Browse the repository at this point in the history
  • Loading branch information
oczkers committed Oct 18, 2017
1 parent f65eaf5 commit cb46d01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions fut/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __login__(self, email, passwd, secret_answer, platform='pc', code=None, totp
self.r.headers = headers_ios.copy() # i'm ios phone now ;-)
else:
self.r.headers = headers.copy() # i'm chrome browser now ;-)
if platform == 'pc':
if platform == 'pc': # TODO: get this from shards
game_sku = 'FFA18PCC'
elif platform == 'xbox':
game_sku = 'FFA18XBO'
Expand All @@ -334,7 +334,7 @@ def __login__(self, email, passwd, secret_answer, platform='pc', code=None, totp
game_sku = 'FFA18PS3' # not tested
elif platform == 'ps4':
game_sku = 'FFA18PS4'
platform = 'ps3' # ps4 not available?
# platform = 'ps3' # ps4 not available in shards
else:
raise FutError(reason='Wrong platform. (Valid ones are pc/xbox/xbox360/ps3/ps4)')
# if self.r.get(self.urls['main_site']+'/fifa/api/isUserLoggedIn', timeout=self.timeout).json()['isLoggedIn']:
Expand Down Expand Up @@ -467,6 +467,7 @@ def __login__(self, email, passwd, secret_answer, platform='pc', code=None, totp
self.fut_host = {
'pc': 'utas.external.s2.fut.ea.com:443',
'ps3': 'utas.external.s2.fut.ea.com:443',
'ps4': 'utas.external.s2.fut.ea.com:443',
'xbox': 'utas.external.s3.fut.ea.com:443',
# 'ios': 'utas.external.fut.ea.com:443',
# 'and': 'utas.external.fut.ea.com:443'
Expand Down
8 changes: 4 additions & 4 deletions fut/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@


class Pin(object):
def __init__(self, sku='FIFA18WEB', sid='', nucleus_id=0, persona_id='', dob=False, platform=False):
self.sku = sku
def __init__(self, sku=None, sid='', nucleus_id=0, persona_id='', dob=False, platform=False):
self.sid = sid
self.nucleus_id = nucleus_id
self.persona_id = persona_id
self.dob = dob
self.platform = platform
rc = requests.get('https://www.easports.com/fifa/ultimate-team/web-app/js/compiled_1.js').text
self.taxv = re.search('PinManager.TAXONOMY_VERSION=([0-9\.]+?)', rc).group(1)
self.sku = sku or re.search('enums.SKU.FUT="(.+?)"', rc).group(1)
self.taxv = re.search('PinManager.TAXONOMY_VERSION=([0-9\.]+)', rc).group(1)
self.tidt = re.search('PinManager.TITLE_ID_TYPE="(.+?)"', rc).group(1)
self.rel = re.search('rel:"(.+?)"', rc).group(1)
self.gid = re.search('gid:([0-9]+?)', rc).group(1)
Expand Down Expand Up @@ -105,7 +105,7 @@ def send(self, events):
"is_sess": self.sid != '',
"custom": self.custom,
"events": events}
# print(data) # DEBUG
print(data) # DEBUG
self.r.options(pin_url)
rc = self.r.post(pin_url, data=json.dumps(data)).json()
if rc['status'] != 'ok':
Expand Down

0 comments on commit cb46d01

Please sign in to comment.