Unable to obtain session ID during login
steam_client.login(username, newpassword, 'new_filename') File "/usr/local/python3/lib/python3.8/site-packages/steampy/client.py", line 132, in login LoginExecutor(self.username, self._password, self.steam_guard['shared_secret'], self._session).login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 43, in login finalized_response = self._finalize_login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 151, in _finalize_login sessionid = self.session.cookies['sessionid'] File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 334, in getitem return self._find_no_duplicates(name) File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 413, in _find_no_duplicates raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") KeyError: "name='sessionid', domain=None, path=None"
Same.
_finallize_login now returns with 403 code. Must be Steam changed authorization procedure.
Same.
_finallize_loginnow returns with 403 code. Must be Steam changed authorization procedure.
Yes, it was normal an hour ago
Same.
Same. Actually I can see my device in autorized devices after login, but still I can't pass through steam.login method. Also someone mentioned that you can't bulk confirm trades in SDA, but you can do it one by one
same
No more sessionID in finalize_login:{'response': {'client_id': '14948508085995000000', 'request_id': '5WzFBXbdwBAfH4QXDza9zA==', 'interval': 0.10000000149011612, 'allowed_confirmations': [{'confirmation_type': 1}], 'steamid': '76561199674400000'}}
@ #432 Here's my fix. I can't test it myself, but it passed all the tests.
@ #432 这是我的修复方法。我无法亲自测试,但它通过了所有测试。
steam_client.login(username, newpassword, 'new_filename')
File "/usr/local/python3/lib/python3.8/site-packages/steampy/client.py", line 132, in login LoginExecutor(self.username, self._password, self.steam_guard['shared_secret'], self._session).login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 43, in login finalized_response = self._finalize_login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 154, in _finalize_login sessionid = self.session.cookies['sessionid'] File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 334, in getitem return self._find_no_duplicates(name) File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 413, in _find_no_duplicates raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}") KeyError: "name='sessionid', domain=None, path=None"
Unfortunately, using your method still results in this error
Try again, I updated it
same,response <403> has been about 6 hours, is here any good idea?
redir = "https://steamcommunity.com/login/home/?goto="
finallez_data = {
'nonce': self.refresh_token,
'sessionid': sessionid,
'redir': redir
}
response = self.session.post("https://login.steampowered.com/jwt/finalizelogin", data=finallez_data, proxies=proxies)
I saw the post URL, and the data has not changed. The nonce information comes from the API, so I think the code does not need to be fixed. So, what's wrong?
Try again, I updated it
steam_client.login(username, newpassword, 'new_filename')
File "/usr/local/python3/lib/python3.8/site-packages/steampy/client.py", line 132, in login LoginExecutor(self.username, self._password, self.steam_guard['shared_secret'], self._session).login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 43, in login finalized_response = self._finalize_login() File "/usr/local/python3/lib/python3.8/site-packages/steampy/login.py", line 155, in _finalize_login sessionid = self.session.cookies['sessionid'] File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 334, in getitem return self._find_no_duplicates(name) File "/usr/local/python3/lib/python3.8/site-packages/requests/cookies.py", line 413, in _find_no_duplicates raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
It's still the same error
Try again, I updated it
waiting u next upload..
Alright, then try commit 6e058b4f66f588c984aab05b585b5c21b59f9ebd. It's hard for me to say why they don't work; I have a parallel branch. Everything is working for me right now.
Try again, I updated it
After your 3rd update it works. You are the best.
Great, see you on the market :)
Great, see you on the market :)
great!! here is the fixed code。
def _finalize_login(self, proxies: dict | None = None) -> requests.Response:
redir = "https://steamcommunity.com/login/home/?goto="
files = {
'nonce': (None, self.refresh_token),
'sessionid': (None, sessionid),
'redir': (None, redir)
}
headers = {
'Referer': redir,
'Origin': 'https://steamcommunity.com'
}
return self.session.post("https://login.steampowered.com/jwt/finalizelogin", headers=headers, files=files)
Alright, then try commit 6e058b4. It's hard for me to say why they don't work; I have a parallel branch. Everything is working for me right now.
Thanks man, you're the best!
the new problem is add friend was response 403 too
i got it, the problem is the request headers, must appoint an Referer and Origin into the headers, else response 403
Alright, then try commit 6e058b4. It's hard for me to say why they don't work; I have a parallel branch. Everything is working for me right now.
Thanks! Good solution, worked for me
sadly make_offer_with_url() also broke :( - response = self._session.get(url, data=params, headers=headers).json() is returning None.
would be very thankful if someone could fix it.
@VlexWest Unfortunately, I can't test this either. But just by analogy, try this option for make_offer_with_url():
params = {
'sessionid': session_id,
'serverid': server_id,
'partner': partner_steam_id,
'tradeoffermessage': message,
'json_tradeoffer': json.dumps(offer),
'captcha': '',
'trade_offer_create_params': json.dumps(trade_offer_create_params),
}
files = {key: (None, str(value)) for key, value in params.items()}
headers = {
'Referer': f'{SteamUrl.COMMUNITY_URL}{urlparse.urlparse(trade_offer_url).path}',
'Origin': SteamUrl.COMMUNITY_URL,
}
response = self._session.post(url, files=files, headers=headers).json()
Sadly not working :(