steampy
steampy copied to clipboard
get_my_inventory not working "Success value should be 1"
This problem appeared last night.
Steampy v1.1.1
How fix?
Steam was updated today, this is probably why your error occurs I tried to repeat your mistake but it didn't work Try to recreate the session It is not recommended to check the functionality of the session via is_session_alive(); at the moment it does not work correctly
@Dandelion101
I created a simple example and tested it. And I get two different errors.
@Onione-Tamiko
Perhaps the error occurs due to the fact that you specify the path to mafile and not to steam_guard.json steam_guard.json = { "steamid": "123", "shared_secret": "123", "identity_secret": "123" }
Do not send the code as a screenshot, it is better to send it in text so that it can be easily copied
@Dandelion101 Example:
import json, pprint, os
from steampy.client import SteamClient, InvalidCredentials
from steampy.models import Currency, GameOptions
from steampy.client import SteamClient, Asset
from steampy.utils import GameOptions
from bs4 import BeautifulSoup
import re
def SerchFile(steam_login = None , directory_maFiles = None ):
if None not in [steam_login,directory_maFiles]:
for file in os.listdir(directory_maFiles):
if '.maFile' in file:
with open(f"{directory_maFiles}\\{file}",'r') as file_read:
maFile = json.loads(file_read.read())
if maFile["account_name"] == steam_login.lower():
print(f'[INFO][SEARCH_MAFILE] maFile для аккаунта {steam_login} был успешно найден.')
return maFile,f"{directory_maFiles}\\{file}"
else:
print(f'[ERROR][SEARCH_MAFILE] maFile для аккаунта {steam_login} не был найден в нужной директории.')
return None
game = GameOptions.STEAM
directory_maFiles = str(os.path.abspath(__file__).replace(os.path.basename(__file__), ''))+'DATA\maFiles'
password = ''
login = ''
api_key = ''
maFile,path_maFile = SerchFile(steam_login = login ,directory_maFiles = directory_maFiles)
steam_client = SteamClient(api_key)
steam_client.login(login, password, path_maFile)
my_inventory = steam_client.get_my_inventory(game)
pprin.pprint(my_inventory)
steam_client.logout()
maFile : {"shared_secret":" ","serial_number":" ","revocation_code":" ","uri":" ","server_time": "","account_name":" ","token_gid":" ","identity_secret":" ","secret_1":" ","status": ,"device_id":" ","fully_enrolled":true,"Session":{"SessionID":" ","SteamLogin":" ","SteamLoginSecure":" ","WebCookie":" ","OAuthToken":" ","SteamID":}}
I use Files created using Steam Desktop Auth(SDA), in the library where "steamid" was required, everything was replaced with ["steamid"] > ['Session']['SteamID'].
I repeat, everything worked until last night)
Error 1:
[INFO][SEARCH_MAFILE] maFile для аккаунта SandraIJGeF1Of был успешно найден.
Traceback (most recent call last):
File "C:\Users\ADMIN\Desktop\Trade_Browser\retertert.py", line 43, in <module>
my_inventory = steam_client.get_my_inventory(game)
File "C:\Users\ADMIN\Python38\lib\site-packages\steampy\utils.py", line 23, in func_wrapper
return func(self, *args, **kwargs)
File "C:\Users\ADMIN\Python38\lib\site-packages\steampy\client.py", line 157, in get_my_inventory
return self.get_partner_inventory(steam_id, game, merge, count)
File "C:\Users\ADMIN\Python38\lib\site-packages\steampy\utils.py", line 23, in func_wrapper
return func(self, *args, **kwargs)
File "C:\Users\ADMIN\Python38\lib\site-packages\steampy\client.py", line 168, in get_partner_inventory
raise ApiException('Success value should be 1.')
steampy.exceptions.ApiException: Success value should be 1.
I am using python version 3.8.10 and 3.10.11. It doesn 't work on both of them .
I tried to delete and recreate the api_key. It didn't help.
I'm using the buy item method from the steampy library. And for the last two days I’ve been receiving this answer:
{'message': 'There was a problem purchasing your item. The listing may have been removed. Refresh the page and try again.'}
2024-01-19 18:26:33,196 - my_logger - WARNING - There was a problem buying this item. Message: There was a problem buying this item. Message: There was a problem purchasing your item. The listing may have been removed. Refresh the page and try again.
I just can’t cope with this problem, can someone tell me something?
@OlegAlyeynikov https://github.com/bukson/steampy/issues/343
Steam update came out last night The last time an update came out and the library broke, the update came out the next day. So I don't think I'll have to wait long for an update.
The last time an update came out and the library broke, the update came out the next day. So I don't think I'll have to wait long for an update.
The same problem. Have you found any solutions?
For some reason, get_my_inventory works every other time. Also, I noticed that .is_session_alive() does not work in 90% of cases.
I've got same error today on prod server, but in development server with the same account and library version it works fine.