You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
627 B

import requests
from binascii import hexlify
from steam.core.crypto import sha1_hash, random_bytes
def make_requests_session():
"""
:returns: requests session
:rtype: :class:`requests.Session`
"""
session = requests.Session()
version = __import__('steam').__version__
ua = "python-steam/{0} {1}".format(version,
session.headers['User-Agent'])
session.headers['User-Agent'] = ua
return session
def generate_session_id():
"""
:returns: session id
:rtype: :class:`str`
"""
return hexlify(sha1_hash(random_bytes(32)))[:32].decode('ascii')