fix: onsale_asset now uses PATCH with collectible_item_id and saleStatus 0
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "rbx-upload"
|
name = "rbx-upload"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
description = "Roblox asset upload client"
|
description = "Roblox asset upload client"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
+11
-23
@@ -255,35 +255,23 @@ class RobloxClient:
|
|||||||
|
|
||||||
async def onsale_asset(
|
async def onsale_asset(
|
||||||
self,
|
self,
|
||||||
asset_id: int,
|
collectible_item_id: str,
|
||||||
name: str,
|
|
||||||
description: str,
|
|
||||||
group_id: int,
|
|
||||||
price: int = 5,
|
price: int = 5,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
"""Put an asset on sale."""
|
"""Put an asset on sale."""
|
||||||
csrf = await self._get_csrf_token()
|
csrf = await self._get_csrf_token()
|
||||||
data = {
|
response = await self._http.patch(
|
||||||
|
f"https://itemconfiguration.roblox.com/v1/collectibles/{collectible_item_id}",
|
||||||
|
json={
|
||||||
"saleLocationConfiguration": {"saleLocationType": 1, "places": []},
|
"saleLocationConfiguration": {"saleLocationType": 1, "places": []},
|
||||||
"targetId": asset_id,
|
"saleStatus": 0,
|
||||||
"priceInRobux": price,
|
|
||||||
"publishingType": 2,
|
|
||||||
"idempotencyToken": str(uuid.uuid4()),
|
|
||||||
"publisherUserId": self._publisher_user_id,
|
|
||||||
"creatorGroupId": group_id,
|
|
||||||
"name": name,
|
|
||||||
"description": description,
|
|
||||||
"isFree": False,
|
|
||||||
"agreedPublishingFee": 0,
|
|
||||||
"priceOffset": 0,
|
|
||||||
"quantity": 0,
|
|
||||||
"quantityLimitPerUser": 0,
|
"quantityLimitPerUser": 0,
|
||||||
"resaleRestriction": 2,
|
"resaleRestriction": 2,
|
||||||
"targetType": 0,
|
"priceInRobux": price,
|
||||||
}
|
"priceOffset": 0,
|
||||||
response = await self._http.post(
|
"optOutFromRegionalPricing": False,
|
||||||
self._proxy_url("https://itemconfiguration.roblox.com/v1/collectibles", force_direct=True),
|
"isFree": False,
|
||||||
json=data,
|
},
|
||||||
headers={
|
headers={
|
||||||
"X-CSRF-TOKEN": csrf,
|
"X-CSRF-TOKEN": csrf,
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0",
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0",
|
||||||
@@ -299,7 +287,7 @@ class RobloxClient:
|
|||||||
raise AuthError("Not authorized to put this asset on sale.")
|
raise AuthError("Not authorized to put this asset on sale.")
|
||||||
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.json()
|
return response.json() if response.text else {}
|
||||||
|
|
||||||
async def close(self):
|
async def close(self):
|
||||||
"""Close the underlying HTTP client."""
|
"""Close the underlying HTTP client."""
|
||||||
|
|||||||
Reference in New Issue
Block a user