Takk8IS / bet365-api-scraper

This project is a scraper of the Bet365 API to collect data from live matches, matches and future games using Python.
https://takk.ag
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

I get $403 error #1

Open andodeki opened 2 weeks ago

andodeki commented 2 weeks ago

$ python api.py /Users/aok/Projects/rustdev/MadeByMakepad/Python/bet365-api-scraper/venv/lib/python3.9/site-packages/urllib3/init.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( 2024-06-17 14:58:48,909 - INFO - Running API script... Initiating request to bet365 API... HTTP error occurred: 403 Client Error: Forbidden for url: https://mobile.bet365.com/inplaydiaryapi/schedule?timezone=16&lid=33&zid=0 2024-06-17 14:58:49,425 - INFO - Result: None

HonzaPavel commented 1 week ago

The solution is this modification:

# import requests
from curl_cffi import requests

and deleting the line:

self.session.mount('https://', HTTPAdapter(max_retries=retries))
RafaelSoares12 commented 1 week ago

Hey @HonzaPavel, thanks for the solution. Do you know how can we get information for a specific event? Has a param for this?

HonzaPavel commented 1 week ago

@RafaelSoares12 Unfortunately my websockets hanshake is not working. My problem is here: https://github.com/Takk8IS/bet365-api-scraper/issues/2.