Added customization for the seat selection.
This commit is contained in:
parent
eef7d24c25
commit
862518a45f
2 changed files with 6 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ BOOKING_API_BASE = "https://b.anny.eu/api/v1"
|
||||||
CHECKOUT_FORM_API = "https://b.anny.eu/api/ui/checkout-form"
|
CHECKOUT_FORM_API = "https://b.anny.eu/api/ui/checkout-form"
|
||||||
RESOURCE_URL = f"{BOOKING_API_BASE}/resources/1-lehrbuchsammlung-eg-und-1-og/children"
|
RESOURCE_URL = f"{BOOKING_API_BASE}/resources/1-lehrbuchsammlung-eg-und-1-og/children"
|
||||||
SERVICE_ID = "449"
|
SERVICE_ID = "449"
|
||||||
|
RESSOURCE_ID = "5993" # None Will be set dynamically if None, else use the given ID
|
||||||
|
|
||||||
DEFAULT_HEADERS = {
|
DEFAULT_HEADERS = {
|
||||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0',
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0',
|
||||||
|
|
|
||||||
6
main.py
6
main.py
|
|
@ -7,6 +7,7 @@ from auth.session import AnnySession
|
||||||
from booking.client import BookingClient
|
from booking.client import BookingClient
|
||||||
from utils.helpers import get_future_datetime
|
from utils.helpers import get_future_datetime
|
||||||
import pytz
|
import pytz
|
||||||
|
from config.constants import RESSOURCE_ID
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
load_dotenv('.env', override=True)
|
load_dotenv('.env', override=True)
|
||||||
|
|
@ -50,7 +51,10 @@ def main():
|
||||||
start = get_future_datetime(hour=time_['start'])
|
start = get_future_datetime(hour=time_['start'])
|
||||||
end = get_future_datetime(hour=time_['end'])
|
end = get_future_datetime(hour=time_['end'])
|
||||||
|
|
||||||
resource_id = booking.find_available_resource(start, end)
|
if RESSOURCE_ID:
|
||||||
|
resource_id = RESSOURCE_ID
|
||||||
|
else:
|
||||||
|
resource_id = booking.find_available_resource(start, end)
|
||||||
|
|
||||||
if resource_id:
|
if resource_id:
|
||||||
booking.reserve(resource_id, start, end)
|
booking.reserve(resource_id, start, end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue