Skip to content

Commit ba8fea2

Browse files
committed
project: bump version (1.4.1rc2)
1 parent cbcfab7 commit ba8fea2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

maimai_py/maimai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from maimai_py.providers import *
2626
from maimai_py.providers.base import IRecordProvider
2727
from maimai_py.utils import UNSET, _UnsetSentinel
28+
from maimai_py.utils.cookies import NullCookieJar
2829

2930
PlayerItemType = TypeVar("PlayerItemType", bound=PlayerItem)
3031

@@ -860,7 +861,7 @@ def __init__(
860861
cache_ttl: the TTL of the cache, defaults to 60 * 60 * 24.
861862
kwargs: other arguments to pass to the `httpx.AsyncClient`.
862863
"""
863-
self._client = AsyncClient(timeout=timeout, **kwargs)
864+
self._client = AsyncClient(timeout=timeout, cookies=NullCookieJar(), **kwargs)
864865
self._cache = SimpleMemoryCache() if isinstance(cache, _UnsetSentinel) else cache
865866
self._cache_ttl = cache_ttl
866867

maimai_py/utils/cookies.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from http.cookiejar import CookieJar
2+
3+
4+
class NullCookieJar(CookieJar):
5+
"""A CookieJar that rejects all cookies."""
6+
7+
def extract_cookies(self, response, request):
8+
"""For extracting and saving cookies. This implementation does nothing"""
9+
pass
10+
11+
def set_cookie(self, cookie):
12+
"""Normally for setting a cookie. This implementation does nothing"""
13+
pass

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "maimai-py"
3-
version = "1.4.1rc1"
3+
version = "1.4.1rc2"
44
description = "The definitive python wrapper for MaimaiCN."
55
authors = ["Usagi no Niku <chenbohan911@163.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)