steamcom 1.2.43__tar.gz → 1.2.45__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {steamcom-1.2.43 → steamcom-1.2.45}/PKG-INFO +1 -1
- {steamcom-1.2.43 → steamcom-1.2.45}/pyproject.toml +1 -1
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/client.py +2 -2
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/market.py +33 -29
- {steamcom-1.2.43 → steamcom-1.2.45}/.github/workflows/pypi_publish.yml +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/.gitignore +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/LICENSE +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/README.md +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/examples/CancelAllListings.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/examples/InventorySender.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/examples/ItemsSeller.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/requirements.txt +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/confirmations.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/exceptions.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/fee_counter.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/guard.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/login.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/models.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/steamcom/utils.py +0 -0
- {steamcom-1.2.43 → steamcom-1.2.45}/tests/test_fee_counter.py +0 -0
|
@@ -9,7 +9,7 @@ packages = ["/steamcom"]
|
|
|
9
9
|
name = "steamcom"
|
|
10
10
|
description = "Python implementation of the Steam Community API"
|
|
11
11
|
# The version uploaded to pypi has been changed by action "pypi_publish.yml"
|
|
12
|
-
version = "1.2.
|
|
12
|
+
version = "1.2.45"
|
|
13
13
|
authors = [
|
|
14
14
|
{ name="Linar Sharifullin"},
|
|
15
15
|
]
|
|
@@ -138,9 +138,9 @@ class SteamClient:
|
|
|
138
138
|
return int(re.search('\\d+', part_with_currency[0])[0])
|
|
139
139
|
|
|
140
140
|
def get_wallet_info(self) -> WalletInfo:
|
|
141
|
-
|
|
141
|
+
my_inventory_resposne = self.session.get(SteamUrl.COMMUNITY + '/my/inventory')
|
|
142
142
|
pattern = r'var g_rgWalletInfo = (\{.*?\});'
|
|
143
|
-
match = re.search(pattern,
|
|
143
|
+
match = re.search(pattern, my_inventory_resposne.text)
|
|
144
144
|
if not match:
|
|
145
145
|
raise ValueError('g_rgWalletInfo not found')
|
|
146
146
|
raw_wallet_info = json.loads(match.group(1))
|
|
@@ -65,37 +65,41 @@ class SteamMarket:
|
|
|
65
65
|
|
|
66
66
|
@login_required
|
|
67
67
|
def get_my_market_listings(self, delay: int = 3) -> dict:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
# response = self.session.get(SteamUrl.COMMUNITY + '/market')
|
|
69
|
+
# if response.status_code != 200:
|
|
70
|
+
# text = 'Problem getting the listings. http code: {}'
|
|
71
|
+
# raise ApiException(text.format(response.status_code))
|
|
72
|
+
# print('Received market page')
|
|
73
|
+
# assets_descriptions = json.loads(
|
|
74
|
+
# text_between(response.text, 'var g_rgAssets = ', ';\n'))
|
|
75
|
+
# listing_id_to_assets_address = \
|
|
76
|
+
# get_listing_id_to_assets_address_from_html(response.text)
|
|
77
|
+
# listings = get_market_listings_from_html(response.text)
|
|
78
|
+
# listings = merge_items_with_descriptions_from_listing(
|
|
79
|
+
# listings, listing_id_to_assets_address, assets_descriptions)
|
|
80
|
+
# listings_end = '<span id="tabContentsMyActiveMarketListings_end">'
|
|
81
|
+
# listings_total = '<span id="tabContentsMyActiveMarketListings_total">'
|
|
82
|
+
listings = {'sell_listings': {}, 'buy_orders': None}
|
|
83
|
+
url = '{}/market/mylistings/render/?query=&start=0&count=100'\
|
|
84
|
+
.format(SteamUrl.COMMUNITY)
|
|
85
|
+
jresp = api_request(self.session, url)
|
|
86
|
+
listing_id_to_assets_address =\
|
|
87
|
+
get_listing_id_to_assets_address_from_html(
|
|
88
|
+
jresp.get('hovers'))
|
|
89
|
+
listings_2 = get_market_sell_listings_from_api(
|
|
90
|
+
jresp.get('results_html'))
|
|
91
|
+
listings_2 = merge_items_with_descriptions_from_listing(
|
|
92
|
+
listings_2, listing_id_to_assets_address,
|
|
93
|
+
jresp.get('assets'))
|
|
94
|
+
listings['sell_listings'] = listings_2['sell_listings']
|
|
95
|
+
listings_total = jresp['total_count']
|
|
96
|
+
if listings_total > 100:
|
|
97
|
+
for start in range(100, listings_total, 100):
|
|
98
|
+
time.sleep(delay)
|
|
99
|
+
listings_2 = self._parse_listings(start, 100)
|
|
100
|
+
print(f'Received listings {len(listings["sell_listings"])}/{listings_total}')
|
|
90
101
|
listings['sell_listings']\
|
|
91
102
|
= listings['sell_listings'] | listings_2
|
|
92
|
-
else:
|
|
93
|
-
for i in range(0, n_total, 100):
|
|
94
|
-
time.sleep(delay)
|
|
95
|
-
listings_2 = self._parse_listings(n_showing + i, 100)
|
|
96
|
-
print(f'Received listings {i}/{n_total}')
|
|
97
|
-
listings['sell_listings']\
|
|
98
|
-
= listings['sell_listings'] | listings_2
|
|
99
103
|
return listings
|
|
100
104
|
|
|
101
105
|
def _parse_listings(self, start: int, count: int) -> dict:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|