Skip to content

Commit

Permalink
fix: cookies broken by aiohttp#7944
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Aug 1, 2024
1 parent ebc3bb4 commit 7a0760a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aiotieba/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAIN_VERSION = "12.65.1.1"
MAIN_VERSION = "12.66.1.0"
POST_VERSION = "12.35.1.0"

APP_SECURE_SCHEME = "https"
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/core/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def set_account(self, new_account: Account) -> None:
BDUSS_morsel = Morsel()
BDUSS_morsel.set('BDUSS', new_account.BDUSS, new_account.BDUSS)
BDUSS_morsel['domain'] = "baidu.com"
self.web.cookie_jar._cookies[("baidu.com", "/")]['BDUSS'] = BDUSS_morsel
self.web.cookie_jar._cookies[("baidu.com", "")]['BDUSS'] = BDUSS_morsel
STOKEN_morsel = Morsel()
STOKEN_morsel.set('STOKEN', new_account.STOKEN, new_account.STOKEN)
STOKEN_morsel['domain'] = "tieba.baidu.com"
self.web.cookie_jar._cookies[("tieba.baidu.com", "/")]['STOKEN'] = STOKEN_morsel
self.web.cookie_jar._cookies[("tieba.baidu.com", "")]['STOKEN'] = STOKEN_morsel

def pack_form_request(self, url: yarl.URL, data: list[tuple[str, str]]) -> aiohttp.ClientRequest:
"""
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aiotieba"
version = "4.4.7a1"
version = "4.4.7"
description = "Asynchronous I/O Client for Baidu Tieba"
authors = [{ name = "Starry-OvO", email = "[email protected]" }]
urls = { Repository = "https://github.com/Starry-OvO/aiotieba/", Documentation = "https://aiotieba.cc/" }
Expand All @@ -22,9 +22,9 @@ classifiers = [
]
requires-python = ">=3.8,<3.14"
dependencies = [
"aiohttp>=3.8.4,<3.11;python_version=='3.8'",
"aiohttp>=3.8.4,<4;python_version>='3.9' and python_version<'3.12'",
"aiohttp>=3.9.0,<4;python_version>='3.12'",
"aiohttp>=3.10.0,<3.11;python_version=='3.8'",
"aiohttp>=3.10.0,<4;python_version>='3.9' and python_version<'3.12'",
"aiohttp>=3.10.0,<4;python_version>='3.12'",
"beautifulsoup4>=4.4.1,<4.13;python_version=='3.8'",
"beautifulsoup4>=4.5.2,<5;python_version=='3.9'",
"beautifulsoup4>=4.7.1,<5;python_version>='3.10'",
Expand All @@ -47,7 +47,6 @@ img = [
"opencv-contrib-python>=4.6.0.66,<5;sys_platform!='linux'",
]
speedup = [
"aiodns>=3.0.0,<4",
"orjson>=2.0.11,<3.11;python_version=='3.8'",
"orjson>=2.2.0,<4;python_version=='3.9'",
"orjson>=3.4.7,<4;python_version=='3.10'",
Expand Down

0 comments on commit 7a0760a

Please sign in to comment.