steam.py
steam.py copied to clipboard
Occassionally getting 401s when interacting with the API
Summary
user.send(trade=trade) result in an error
Reproduction Steps
- Fetch a user from steam id 64
- Fetch bot inventory
- Get item from class_id
- Construct a trade from this item and trade token
- Send a trade to the user
- Decline the trade on the client side
- Repeat 2, 3, 4, 5 steps
- Got an error 401 Unauthorized
Expected Results
Successfully sent trade offet
Actual Results
Error 401
System Information
python 3.8 Ubuntu 20 Version of the library 0.8.5
Checklist
- [X] I have searched the issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my username/password/secrets from display, if visible.
Do you have a code snippet for this?
Sorry for screenshots, just dont want to share the whole mess of code =)
message.trade_token and etc message is just a dataclass with data needed to send a trade offer
And another thing. Error still happens on every trade I'am sending after that errored trade, but if I restart the bot, error disappears
Could this be fixed?
I'm sorry I haven't had time to properly debug this, I'll try and take a look at this over the weekend
I'm sorry I haven't had time to properly debug this, I'll try and take a look at this over the weekend
Your fast answers are awesome. Thank you :)
I can't reproduce this at least not with the steps provided. You might have been temporarily banned by Steam.
I can send offers from official client at the same time
IDK what's up then if it works the first time but then not after declining a trade.
@TrixiS I'm curious if you can reproduce this on a different account on a different network or after not using the account you are currently using for a week or so.
- Decline the trade on the client side
Who declines the offer at step 6?
Is it the person who initiated the trade who cancels it, or the person who was offered the trade who declines it?
This reminds me of an issue which I encountered with Steam groups. I think it went this way:
- Invite a user to an invitation-only group,
- The invited user cancels the invite,
- Invite the same user again,
- The invited user cannot accept the new invite. He would receive an error similar to the OP when trying to accept it.
I see that the OP only encounters the issue with this tool, and not with the official client. In my case, I was only using the web browser, and I did not have the idea to check whether the issue with group invites would have been solved by using the official client. I believe it could be an issue due to a cool-down created by Valve to avoid spamming offers/invites with anything else than the official client.
@TrixiS can you also comment on whether or not you were using the web browser to send trades or the actual Steam app?
Coming back to this it's possible that the account was logged out by Steam.
Closing as this is stale