steam.py icon indicating copy to clipboard operation
steam.py copied to clipboard

Occassionally getting 401s when interacting with the API

Open TrixiS opened this issue 2 years ago • 13 comments

Summary

user.send(trade=trade) result in an error

Reproduction Steps

  1. Fetch a user from steam id 64
  2. Fetch bot inventory
  3. Get item from class_id
  4. Construct a trade from this item and trade token
  5. Send a trade to the user
  6. Decline the trade on the client side
  7. Repeat 2, 3, 4, 5 steps
  8. Got an error 401 Unauthorized image

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.

TrixiS avatar Jan 10 '22 18:01 TrixiS

Do you have a code snippet for this?

Gobot1234 avatar Jan 10 '22 18:01 Gobot1234

Sorry for screenshots, just dont want to share the whole mess of code =)

image image image

message.trade_token and etc message is just a dataclass with data needed to send a trade offer

TrixiS avatar Jan 10 '22 18:01 TrixiS

And another thing. Error still happens on every trade I'am sending after that errored trade, but if I restart the bot, error disappears

TrixiS avatar Jan 10 '22 19:01 TrixiS

Could this be fixed?

TrixiS avatar Jan 13 '22 20:01 TrixiS

I'm sorry I haven't had time to properly debug this, I'll try and take a look at this over the weekend

Gobot1234 avatar Jan 13 '22 20:01 Gobot1234

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 :)

TrixiS avatar Jan 13 '22 20:01 TrixiS

I can't reproduce this at least not with the steps provided. You might have been temporarily banned by Steam.

Gobot1234 avatar Jan 14 '22 21:01 Gobot1234

I can send offers from official client at the same time

TrixiS avatar Jan 14 '22 21:01 TrixiS

IDK what's up then if it works the first time but then not after declining a trade.

Gobot1234 avatar Jan 14 '22 21:01 Gobot1234

@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.

Gobot1234 avatar Jan 17 '22 21:01 Gobot1234

  1. 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:

  1. Invite a user to an invitation-only group,
  2. The invited user cancels the invite,
  3. Invite the same user again,
  4. The invited user cannot accept the new invite. He would receive an error similar to the OP when trying to accept it.

Discord chat

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.

woctezuma avatar Feb 15 '22 19:02 woctezuma

@TrixiS can you also comment on whether or not you were using the web browser to send trades or the actual Steam app?

Gobot1234 avatar Feb 16 '22 02:02 Gobot1234

Coming back to this it's possible that the account was logged out by Steam.

Gobot1234 avatar Jun 09 '22 12:06 Gobot1234

Closing as this is stale

Gobot1234 avatar Oct 10 '22 14:10 Gobot1234