Giter Site home page Giter Site logo

soccerapi-server's Introduction

soccerapi-server

soccerapi-server is a repo created to support the soccerapi repo with not-python code running in the background to serve to soccerapi Python package. Currently it only contains a script to obtain a specific Bet365 header required to make calls for the Bet365 api (read below for further details). In the future if additional background scripts will be needed, they will be integrated in the docker and added here.

Installation & Usage

To run everything smoothly in background with no window popping up and no need to worry about dependencies, install Docker and run the deamon on your machine. To download and update the soccerapi-server docker

docker pull s1m0n38/soccerapi

This command pull the soccerapi image from Docker Hub. The image is quite heavy (944 MB) because it packs all the dependencies needed to run soccerapi-server (linux, node, chromium, graphical libraries to run chromium in "headful" mode).

After you have s1m0n38/soccerapi on your local machine, to run it simply type

docker run --rm -it -p 5000:5000 s1m0n38/soccerapi

To kill the process and stop the docker just use Ctrl+C

Bet365 X-Net-Sync-Term

At the beginning of 2021 bet365 implemented authentication with the X-Net-Sync-Term header for pre-match odds. It's now mandatory to send a valid X-Net-Sync-Term header with every http requests. This XNST (X-Net-Sync-Term) is generated by client side JavaScript but due to obfuscation of the code it is complicated to reverse-engineer the script to generate the header on your own.

The approach followed here is to generate a valid XNST with a browser and then use the newly generated XNST for your http requests.

soccerapi-server every 10 minutes generates a valid XNST and exposes it on the localhost. While the docker container is running in background (see Installation & Usage) you have a valid X-Net-Sync-Term at http://localhost:5000/bet365.

The soccerapi package automatically picks the XNST posted by the docker on the localhost. Then in order to retreive data from Bet365 with soccerapi you need to have the docker running in the background.

soccerapi-server's People

Contributors

s1m0n38 avatar muuusso avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.