steampy icon indicating copy to clipboard operation
steampy copied to clipboard

Can't create trade offer using steam_guard.json & trade_url

Open VlexWest opened this issue 1 year ago • 2 comments

*UPDATE: I applied the changes from PR and now it's logging in, but if I try to create a trade make_offer_with_url() I get Response 401 Unauthorized...

Now I need help with it, so would appreciate any help. :')

Code:

# Code to login
# ...
# ...

# Returns "None" because receiving 401 Unauthorized
game = GameOptions.CS
my_items = steam_client.get_my_inventory(game)
my_first_item = next(iter(my_items.values()))
my_asset = Asset(my_first_item['id'], game)
x = steam_client.make_offer_with_url(items_from_me=[my_asset],
                                     items_from_them=[],
                                     trade_offer_url="https://steamcommunity.com/tradeoffer/new/?partner=150059734&token=m3TeWVQA",
                                     message="test message")

here's a screenshot from steampy/client.py with debug values image

--

Hello everyone,

somehow I can't login to steam using my steam_guard.json.

Do someone know how to fix it? Am I doing something wrong?

test.py

from steampy.client import SteamClient

steam_id = 123456789
api_key = "xxxxxxxx"
steam_client = SteamClient(api_key=api_key)

# Can read from file
with open(file="steam_guard.json", mode="r") as x:
    print(x.read())

steam_client.login(username="xxxxx", password="xxxxx",
                   steam_guard=f"steam_guard.json")

# Returns False
print(steam_client.is_session_alive())

steam_guard.json

{
  "steamid": "123456789",
  "shared_secret": "xxxxxxxxx",
  "identity_secret": "xxxxxxxxx"
}

Thanks in advance!

VlexWest avatar Jan 31 '24 17:01 VlexWest

this worked for me, thanks to @xidios

VlexWest avatar Jan 31 '24 18:01 VlexWest

show "code to login" or use login method and send a request for the function to create an ofer immediately after the login

def login: ***login ***login ***is_session_alive() if is_session_alive == True: main()

def main(): ***create order with your params

Aarab228 avatar Feb 01 '24 05:02 Aarab228