fut icon indicating copy to clipboard operation
fut copied to clipboard

NO_TRADE_EXISTS when bid with fast=True

Open tosssman opened this issue 6 years ago • 2 comments

xxx.py:

import fut
...

bot = fut.Core(...)
count = 0
while count < 100:
    bs = bot.search(...)
    for x in bs:
        flag = bot.bid(x['tradeId'], 200, fast=True)
        print(flag)
        if flag:
            bot.sendToClub(x['id'])
            count += 1
            print("count:%d" % (count))
...

error:

...
False
True
count:78
True
count:79
True
count:80
https://utas.external.s2.fut.ea.com:443/ut/game/fifa18/trade/217240384218/bid?sku_b=FFT18
{"bid": 200}
{'sku_b': 'FFT18'}
{'Content-Length': '20', 'Content-Encoding': 'gzip', 'X-UnzippedLength': '0', 'Access-Control-Expose-Headers': 'Retry-After', 'Server': 'Jetty(9.4.7.v20170914)', 'Date': 'Thu, 03 May 2018 17:55:46 GMT'}
478
<RequestsCookieJar[]>

Traceback (most recent call last):
  File "xxx.py", line 53, in <module>
    flag = bot.bid(x['tradeId'], 200, fast=True)
  File "build/bdist.linux-x86_64/egg/fut/core.py", line 1047, in bid
  File "build/bdist.linux-x86_64/egg/fut/core.py", line 752, in __request__
fut.exceptions.UnknownError

does anyone know how to avoid this error?

tosssman avatar May 03 '18 18:05 tosssman

yes, it is an error when the trade is expired or the tradeid is invalid.

derSoerrn95 avatar May 03 '18 19:05 derSoerrn95

search_result = bot.search(...)[1:random.randint(4, 6)]

time.sleep(60)

It works for me

tosssman avatar May 07 '18 12:05 tosssman