diff --git a/.gitignore b/.gitignore index a96eaf3..4fb1c10 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,9 @@ content.log error.log fut.log test.log -testemu.py screenlog.0 codecov.yml club_players.txt database.db relist.py +*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 diff --git a/fut/core.py b/fut/core.py index 117bd9a..ac93a4a 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: @@ -1625,5 +1624,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. +