Skip to content

Commit 4aadbea

Browse files
committed
v0.1.16.1
1 parent 15f7d1a commit 4aadbea

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

FunPayAPI/account.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,10 @@ def send_review(self, order_id: str, text: str, rating: Literal[1, 2, 3, 4, 5] =
835835
"accept": "*/*",
836836
"x-requested-with": "XMLHttpRequest"
837837
}
838+
text = text.strip()
838839
payload = {
839840
"authorId": self.id,
840-
"text": f"{text}{self.__bot_character}",
841+
"text": f"{text}{self.__bot_character}" if text else text,
841842
"rating": rating,
842843
"csrf_token": self.csrf_token,
843844
"orderId": order_id
@@ -1326,7 +1327,7 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
13261327
state: Optional[Literal["closed", "paid", "refunded"]] = None, game: Optional[int] = None,
13271328
section: Optional[str] = None, server: Optional[int] = None,
13281329
side: Optional[int] = None, locale: Literal["ru", "en", "uk"] | None = None,
1329-
sudcategories: dict[str, tuple[types.SubCategoryTypes, int]] = None, **more_filters) -> \
1330+
subcategories: dict[str, tuple[types.SubCategoryTypes, int]] | None = None, **more_filters) -> \
13301331
tuple[str | None, list[types.OrderShortcut], Literal["ru", "en", "uk"],
13311332
dict[str, types.SubCategory]]:
13321333
"""
@@ -1380,6 +1381,8 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
13801381
raise exceptions.AccountNotInitiatedError()
13811382

13821383
exclude_ids = exclude_ids or []
1384+
_subcategories = more_filters.pop("sudcategories", None)
1385+
subcategories = subcategories or _subcategories
13831386
filters = {"id": id, "buyer": buyer, "state": state, "game": game, "section": section, "server": server,
13841387
"side": side}
13851388
filters = {name: filters[name] for name in filters if filters[name]}
@@ -1411,7 +1414,7 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
14111414

14121415
order_divs = parser.find_all("a", {"class": "tc-item"})
14131416
if not start_from:
1414-
sudcategories = dict()
1417+
subcategories = dict()
14151418
app_data = json.loads(parser.find("body").get("data-app-data"))
14161419
locale = app_data.get("locale")
14171420
self.csrf_token = app_data.get("csrf-token") or self.csrf_token
@@ -1425,11 +1428,11 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
14251428
section_type, section_id = key.split("-")
14261429
section_type = types.SubCategoryTypes.COMMON if section_type == "lot" else types.SubCategoryTypes.CURRENCY
14271430
section_id = int(section_id)
1428-
sudcategories[f"{game_name}, {section_name}"] = self.get_subcategory(section_type, section_id)
1431+
subcategories[f"{game_name}, {section_name}"] = self.get_subcategory(section_type, section_id)
14291432
else:
1430-
sudcategories = None
1433+
subcategories = None
14311434
if not order_divs:
1432-
return None, [], locale, sudcategories
1435+
return None, [], locale, subcategories
14331436

14341437
sales = []
14351438
for div in order_divs:
@@ -1462,8 +1465,8 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
14621465
buyer_id = int(buyer_div.get("data-href")[:-1].split("/users/")[1])
14631466
subcategory_name = div.find("div", {"class": "text-muted"}).text
14641467
subcategory = None
1465-
if sudcategories:
1466-
subcategory = sudcategories.get(subcategory_name)
1468+
if subcategories:
1469+
subcategory = subcategories.get(subcategory_name)
14671470

14681471
now = datetime.now()
14691472
order_date_text = div.find("div", {"class": "tc-date-time"}).text
@@ -1492,7 +1495,7 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
14921495
order_status, order_date, subcategory_name, subcategory, str(div))
14931496
sales.append(order_obj)
14941497

1495-
return next_order_id, sales, locale, sudcategories
1498+
return next_order_id, sales, locale, subcategories
14961499

14971500
def get_sells(self, start_from: str | None = None, include_paid: bool = True, include_closed: bool = True,
14981501
include_refunded: bool = True, exclude_ids: list[str] | None = None,

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
......................','.",`............ ..................
5757
............................................................"""
5858

59-
VERSION = "0.1.16"
59+
VERSION = "0.1.16.1"
6060

6161
Utils.cardinal_tools.set_console_title(f"FunPay Cardinal v{VERSION}")
6262

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ colorama>=0.4.6
44
requests==2.28.1
55
pytelegrambotapi==4.15.2
66
pillow>=9.3.0
7-
aiohttp==3.9.0
87
requests_toolbelt==0.10.1
98
lxml>=5.3.0
109
bcrypt>=4.2.0

0 commit comments

Comments
 (0)