Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added year, guid into urls #428

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Development Lead
- Piotr Staroszczyk <[email protected]>


Documentation mainteiner
Documentation maintainer
------------------------

- Trevor McCormick @TrevorMcCormick
Expand Down
4 changes: 3 additions & 1 deletion fut/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import requests
from python_anticaptcha import AnticaptchaClient, FunCaptchaTask, Proxy


try:
from python_anticaptcha.exceptions import AnticaptchaException
except ImportError:
Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions fut/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import requests
import re

from .exceptions import FutError

Expand All @@ -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()
Expand All @@ -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.