From 0e2e7743e7ff07a944316800e26da3eb564d9e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Borgstedt?= Date: Mon, 8 Oct 2018 15:15:52 +0200 Subject: [PATCH 1/4] merged into current futapi version, added token, cookies, stats and test to gitignore --- .gitignore | 4 ++++ fut/core.py | 3 +++ fut/urls.py | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index a96eaf3..0dc73f7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ codecov.yml club_players.txt database.db relist.py +*cookies.txt +*stats.json +*token.txt +*test.json diff --git a/fut/core.py b/fut/core.py index 7452f56..6e971b7 100644 --- a/fut/core.py +++ b/fut/core.py @@ -1623,5 +1623,8 @@ def objectives(self, scope='all'): rc = self.__request__(method, url, params=params) return rc + def get_user_mass_info(self): + return self._usermassinfo + def get_stats_instance(self): return self.stats diff --git a/fut/urls.py b/fut/urls.py index 78f44c6..17595c6 100644 --- a/fut/urls.py +++ b/fut/urls.py @@ -1,4 +1,5 @@ import requests +import re from .exceptions import FutError @@ -9,6 +10,14 @@ client_id = rc['eadpClientId'] fun_captcha_public_key = rc['funCaptchaPublicKey'] +# dynamic hex numbers: +rc = requests.get('https://www.easports.com/de/fifa/ultimate-team/web-app/').text + +resourceRoot = re.search('resourceRoot\s*=\s*"(.+?)\";', rc).group(1) +resourceBase = re.search('resourceBase\s*=\s*"(.+?)\";', rc).group(1) +guid = re.search('guid\s*=\s*"(.+?)\";', rc).group(1) +year = re.search('year\s*=\s*"(.+?)\";', rc).group(1) + # remote config - should be refresh every x seconds rc = requests.get('https://www.easports.com/fifa/ultimate-team/web-app/content/7D49A6B1-760B-4491-B10C-167FBC81D58A/2019/fut/config/companion/remoteConfig.json').json() @@ -31,3 +40,4 @@ card_info_url = 'https://fifa19.content.easports.com/fifa/fltOnlineAssets/7D49A6B1-760B-4491-B10C-167FBC81D58A/2019/fut/items/web/' # TODO: get hash from somewhere, dynamic year # TODO: could be nice to add locals on startup messages_url = 'https://www.easports.com/fifa/ultimate-team/web-app/loc/en_US.json' # TODO: needs to base64 decoded. + From 8f625a68a4dc67d8bb570e83cf7726794445ac67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Borgstedt?= Date: Mon, 8 Oct 2018 15:23:35 +0200 Subject: [PATCH 2/4] removed unnecessary lines --- fut/core.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fut/core.py b/fut/core.py index 6e971b7..ce3cd85 100644 --- a/fut/core.py +++ b/fut/core.py @@ -17,7 +17,6 @@ import requests from python_anticaptcha import AnticaptchaClient, FunCaptchaTask, Proxy - try: from python_anticaptcha.exceptions import AnticaptchaException except ImportError: @@ -30,7 +29,6 @@ try: # python2 compatibility input = raw_input - FileNotFoundError except NameError: FileNotFoundError = IOError From f247f117ec67587cb4d7b60469d88bb3f7a653ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Borgstedt?= Date: Mon, 8 Oct 2018 15:26:23 +0200 Subject: [PATCH 3/4] ups :D --- fut/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fut/core.py b/fut/core.py index ce3cd85..a015cde 100644 --- a/fut/core.py +++ b/fut/core.py @@ -29,6 +29,7 @@ try: # python2 compatibility input = raw_input + FileNotFoundError except NameError: FileNotFoundError = IOError From 4cbb91c2ffe7311eeb27158616e7144213ac9709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Borgstedt?= Date: Mon, 8 Oct 2018 15:31:12 +0200 Subject: [PATCH 4/4] sorry intellij duplicated the cookies token, stats lines.. --- .gitignore | 4 ---- AUTHORS.rst | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0dc73f7..4fb1c10 100644 --- a/.gitignore +++ b/.gitignore @@ -17,13 +17,9 @@ content.log error.log fut.log test.log -testemu.py screenlog.0 codecov.yml club_players.txt database.db relist.py -*cookies.txt -*stats.json -*token.txt *test.json diff --git a/AUTHORS.rst b/AUTHORS.rst index 4cc92ee..2f4d7cd 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -6,7 +6,7 @@ Development Lead - Piotr Staroszczyk -Documentation mainteiner +Documentation maintainer ------------------------ - Trevor McCormick @TrevorMcCormick