woctezuma / steam-market

Find arbitrages on the Steam Market.
MIT License
158 stars 17 forks source link

AssertionError #29

Closed henrydatei closed 1 year ago

henrydatei commented 1 year ago

I ran into the next error with market-arbitrage.py. This error sometimes comes up and sometimes not

Traceback (most recent call last):
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 526, in <module>
    main()
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 509, in main
    apply_workflow(
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 427, in apply_workflow
    filtered_badge_data = get_filtered_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 380, in get_filtered_badge_data
    aggregated_badge_data = load_aggregated_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_utils.py", line 189, in load_aggregated_badge_data
    aggregated_badge_data = aggregate_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_utils.py", line 125, in aggregate_badge_data
    gem_price = get_gem_price(
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 86, in get_gem_price
    sack_of_gems_price = load_sack_of_gems_price(retrieve_gem_price_from_scratch, verbose=verbose)
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 61, in load_sack_of_gems_price
    sack_of_gems_price = download_sack_of_gems_price(sack_of_gems_listing_file_name)
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 47, in download_sack_of_gems_price
    raise AssertionError()
AssertionError

Data in personal_info.json

{
    "steamLoginSecure": "7656***",
    "browserid": "285***",
    "steamMachineAuth7656***": "F5801***",
    "sessionid": "1aa***"
}

Console output:

Parsing the one-line javascript code displayed with the web browser.
Loading 11915 listings from disk.
[100/11604]
[200/11604]
...
[9300/11604]
Wrong status code (429) for start_index = 9400 after 44 queries.
Omitting dubious listing hash: 278360-#Economy_TradingCards_Type_GameType
Omitting dubious listing hash: 219740-#Economy_TradingCards_Type_GameType
Omitting dubious listing hash: 218620-#Economy_TradingCards_Type_GameType
Omitting dubious listing hash: 730-#Economy_TradingCards_Type_GameType
Omitting dubious listing hash: 464760-#Economy_TradingCards_Type_GameType
Omitting dubious listing hash: 209670-Cortex Command #Economy_TradingCards_ItemType_BoosterPack
Omitting dubious listing hash: 381210-Dead by Daylight #Economy_TradingCards_ItemType_BoosterPack
Omitting dubious listing hash: 570-Dota 2 #Economy_TradingCards_ItemType_BoosterPack
Omitting dubious listing hash: 279720-The I of the Dragon #Economy_TradingCards_ItemType_BoosterPack
Omitting dubious listing hash: 893180-#Economy_TradingCards_Type_GameType
There are 11905 seemingly valid market listings. (10 omitted because of a dubious listing hash)
#badges = 86 ; #matching hashes found = 86
Traceback (most recent call last):
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 526, in <module>
    main()
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 509, in main
    apply_workflow(
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 427, in apply_workflow
    filtered_badge_data = get_filtered_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_arbitrage.py", line 380, in get_filtered_badge_data
    aggregated_badge_data = load_aggregated_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_utils.py", line 189, in load_aggregated_badge_data
    aggregated_badge_data = aggregate_badge_data(
  File "/Users/henryhaustein/Downloads/steam-market/market_utils.py", line 125, in aggregate_badge_data
    gem_price = get_gem_price(
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 86, in get_gem_price
    sack_of_gems_price = load_sack_of_gems_price(retrieve_gem_price_from_scratch, verbose=verbose)
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 61, in load_sack_of_gems_price
    sack_of_gems_price = download_sack_of_gems_price(sack_of_gems_listing_file_name)
  File "/Users/henryhaustein/Downloads/steam-market/sack_of_gems.py", line 47, in download_sack_of_gems_price
    raise AssertionError()
AssertionError
woctezuma commented 1 year ago

This is a safety measure when the price of a sack of gems cannot be retrieved: the status code of the response is not 200.

https://github.com/woctezuma/steam-market/blob/57c717118fed8c660bd830f51f0ccfaf45fd5e40/sack_of_gems.py#L47

Unfortunately, this usually means that you have reached Steam's rate limit, in which case there is little we can do about this.

Your best action would be to try to manually update the values of the cookie. However, as you mention that the error does not always happen, then this is most likely due to rate limits (and a temporary ban for too many requests) rather than obsolete cookies.