Skip to content

Commit

Permalink
RaceCard appKey regex update
Browse files Browse the repository at this point in the history
orjson upgraded to 3.10.7
black upgraded to 24.8.0
  • Loading branch information
liampauling committed Oct 3, 2024
1 parent 8ec3c29 commit 7f95591
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
14 changes: 11 additions & 3 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
Release History
---------------

2.20.2 (2024-05-29)
2.20.3 (2024-09-03)
+++++++++++++++++++

**Improvements**
**Bug Fixes**

-
- RaceCard appKey regex update

**Dependencies**

- orjson upgraded to 3.10.7
- black upgraded to 24.8.0

2.20.2 (2024-05-29)
+++++++++++++++++++

**Dependencies**

Expand Down
2 changes: 1 addition & 1 deletion betfairlightweight/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = "betfairlightweight"
__description__ = "Lightweight python wrapper for Betfair API-NG"
__url__ = "https://github.com/betcode-org/betfair"
__version__ = "2.20.2"
__version__ = "2.20.3"
__author__ = "Liam Pauling"
__license__ = "MIT"
5 changes: 2 additions & 3 deletions betfairlightweight/endpoints/racecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def login(self, session: requests.Session = None) -> None:
raise APIError(None, self.login_url, None, e)
except Exception as e:
raise APIError(None, self.login_url, None, e)
app_key = re.findall(
r'''"appKey":\s"(.*?)"''', response.content.decode("utf-8")
)
pattern = r'"default":\s*{\s*"EDSKey":\s*"([^"]+)"'
app_key = re.findall(pattern, response.content.decode("utf-8"))
if app_key:
self.app_key = app_key[0]
else:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ dynamic = ["version"]
[project.optional-dependencies]
speed = [
"ciso8601==2.3.1",
"orjson==3.10.3",
"orjson==3.10.7",
]
test = [
"black==24.4.2",
"black==24.8.0",
"coverage",
"mkdocs",
"mkdocs-material",
Expand Down
2 changes: 1 addition & 1 deletion requirements-speed.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ciso8601==2.3.1
orjson==3.10.3
orjson==3.10.7
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
requests<2.33.0

# Tests & Linting
black==24.4.2
black==24.8.0
coverage

# Documentation
Expand Down
2 changes: 1 addition & 1 deletion tests/test_racecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_init(self):
def test_login(self):
mock_session = mock.Mock()
mock_response = mock.Mock()
mock_response.content = '"appKey": "1234",'.encode("utf-8")
mock_response.content = '"default": {"EDSKey": "1234",},'.encode("utf-8")
mock_session.get.return_value = mock_response
self.race_card.login(mock_session)

Expand Down

0 comments on commit 7f95591

Please sign in to comment.