Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlexTwice opened this issue Jan 31, 2024 · 2 comments
Open

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

AlexTwice opened this issue Jan 31, 2024 · 2 comments

Comments

@AlexTwice
Copy link

AlexTwice commented Jan 31, 2024

*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!

@AlexTwice AlexTwice changed the title Can't login to steam using steam_guard.json Can't create trade offer using steam_guard.json & trade_url Jan 31, 2024
@AlexTwice
Copy link
Author

this worked for me, thanks to @xidios

@Aarab228
Copy link

Aarab228 commented Feb 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants