Skip to content

Commit

Permalink
update VCR; fix SteamID.from_url for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
rossengeorgiev committed Apr 18, 2020
1 parent ae0656a commit dd12503
Show file tree
Hide file tree
Showing 6 changed files with 2,418 additions and 1,818 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ six>=1.10.0
pycryptodomex>=3.7.0
requests>=2.9.1,<2.22.0
vdf>=2.0
gevent>=1.2.0
gevent>=1.3.0
protobuf>=3.0.0
gevent-eventemitter>=2.1
enum34==1.1.2; python_version < '3.4'
Expand All @@ -11,7 +11,7 @@ pytest==3.2.1
pytest-cov==2.5.1
mock==1.3.0
PyYAML==5.1
vcrpy==1.7.4
vcrpy==2.0.1
sphinx==1.8.5
sphinx_rtd_theme
cachetools>=3.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'pycryptodomex>=3.7.0',
'requests>=2.9.1,<2.22.0',
'vdf>=2.0',
'gevent>=1.2.0',
'gevent>=1.3.0',
'protobuf>=3.0.0',
'gevent-eventemitter>=2.1',
'cachetools>=3.0.0',
Expand Down
2 changes: 1 addition & 1 deletion steam/steamid.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def steam64_from_url(url, http_timeout=30):
# group profiles
else:
text = web.get(match.group('clean_url'), timeout=http_timeout).text
data_match = re.search("'steam://friends/joinchat/(?P<steamid>\d+)'", text)
data_match = re.search("OpenGroupChat\( *'(?P<steamid>\d+)'", text)

if data_match:
return int(data_match.group('steamid'))
Expand Down
12 changes: 10 additions & 2 deletions tests/generete_webauth_vcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@

from steam import webauth as wa

try:
_input = raw_input
except:
_input = input

# personal info scrubbers
# -----------------------
# The recorded vcr is anonymized and should not contain
# any personal info. MAKE SURE TO CHECK THE VCR BEFORE COMMIT TO REPO

def request_scrubber(r):
r['headers'].pop('set-cokie', None)
# print(repr(r), r.headers)
r.headers.pop('Cookie', None)
r.headers['Accept-Encoding'] = 'identity'
r.body = ''
return r

def response_scrubber(r):
print(repr(r))
if 'set-cookie' in r['headers'] and 'steamLogin' in ''.join(r['headers']['set-cookie']):
r['headers']['set-cookie'] = [
'steamLogin=0%7C%7C{}; path=/; httponly'.format('A'*16),
Expand Down Expand Up @@ -66,7 +74,7 @@ def response_scrubber(r):

def user_pass_only():
print("Please enter a user that can login with just password.")
u = raw_input("Username: ")
u = _input("Username: ")
p = getpass("Password (no echo): ")

user_pass_only_success(u, p)
Expand Down
Loading

0 comments on commit dd12503

Please sign in to comment.