bukson / steampy

A Steam trading library for python 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get a cookie for future use

luckyway7 opened this issue · comments

from steampy.client import SteamClient

login_cookies = {} # provide dict with cookies
steam_client = SteamClient('MY_API_KEY',username='MY_USERNAME',login_cookies=login_cookies)
assert steam_client.was_login_executed

Steampy has a method for logging in using cookies.
My question is how can I get these cookies if I am logged in using my username and password?

The ‍‍‍SteamClient class has a private property named _session, which is an instance of requests.Session(). Although _session is private and direct usage is discouraged, you can still utilize method _session.cookies.get_dict() for this purpose.