Timeouts downloading data with betfairlightweight

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • strangecarr
    Junior Member
    • Apr 2019
    • 10

    #1

    Timeouts downloading data with betfairlightweight

    Hi, have purchased a load of data on the basic plan and trying to download using betfairlightweight. Am using the code provided on the github page to download the data, but keep getting timeouts. Any advice? It does seem to work intermittently...

    Here is an extract of the error code, is it just that the API is taking too long to respond?

    betfairlightweight.exceptions.APIError: GetCollectionOptions
    Params: {'toYear': 2019, 'toMonth': 5, 'toDay': 31, 'fromYear': 2016, 'fromMonth': 1, 'fromDay': 1, 'plan': 'Basic Plan', 'sport': 'Soccer'}
    Exception: HTTPSConnectionPool(host='historicdata.betfair.com ', port=443): Read timed out. (read timeout=16)
  • LiamP
    Junior Member
    • Oct 2015
    • 284

    #2
    Looks like the timeout needs to be boosted, try monkey patching before the request with this:

    trading.historic.read_timeout = 100

    Comment

    • strangecarr
      Junior Member
      • Apr 2019
      • 10

      #3
      Thanks, that did the trick in letting the files download. Now I can't unzip them using terminal command as I was able to when I downloaded files from the betfair website. I wanted to use your script as it was getting quite cumbersome using the website to download the specific markets I wanted.

      The files I have are .bz2 but I get an error when using following command:
      find . -type f -exec bunzip2 {} +

      xxxx.bz2 is not a bzip2 file.

      Seems a strange one....any reason why the files might be slightly different downloading using betfairlightweight?

      Comment

      Working...
      X