bukson / steampy

A Steam trading library for python 3
MIT License
574 stars 155 forks source link

Failing to create sell orders #390

Open pudjojotaro opened 6 months ago

pudjojotaro commented 6 months ago

Ok, so I'm using the same code that worked fine 6 months ago, using the default create_sell_order function. I get past the login and getting the inventory, I get the correct item IDs, but when I call the create_sell_order I get a response saying "There was a problem listing your item. Refresh the page and try again"

Any suggestions why this might be happening? Thanks in advance.

image

image

borisenko09 commented 6 months ago

image this is what I use

@login_required
    def create_sell_order(self, assetid: str, game: GameOptions, money_to_receive: str) -> dict:
        data = {
            'assetid': assetid,
            'sessionid': self._session.cookies.get_dict("steamcommunity.com")['sessionid'],
            'contextid': game.context_id,
            'appid': game.app_id,
            'amount': 1,
            'price': money_to_receive,
        }
        headers = {'Referer': f'{SteamUrl.COMMUNITY_URL}/profiles/{self._steam_guard["steamid"]}/inventory'}

        response = self._session.post(f'{SteamUrl.COMMUNITY_URL}/market/sellitem/', data, headers=headers).json()
        has_pending_confirmation = 'pending confirmation' in response.get('message', '')
        if response.get('needs_mobile_confirmation') or (not response.get('success') and has_pending_confirmation):
            return self._confirm_sell_listing(assetid)

        return response