Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion allocine/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ def __init__(
def get_theater(self, theater_id: str) -> Theater:
resp = self._client.get_showtimelist_by_theater_id(theater_id=theater_id)
if not resp.get("results"):
raise ValueError(f"Theater not found. Is theater id {theater_id!r} correct?")
try:
return self._get_theater_details_from_page(theater_id)
except ValueError:
raise ValueError(f"Theater not found. Is theater id {theater_id!r} correct?") from None

movie_id: int | None = jmespath.search("results[0].movie.internalId", resp)
assert movie_id is not None, "We need at least one showtime to get details about a theater"
Expand All @@ -158,6 +161,13 @@ def get_showtimes(
theater_id=theater_id,
date=requested_date,
)
if response.get("error") is True and response.get("message") == "no.showtime.error":
break
if response.get("error") is True and response.get("message") == "next.showtime.on":
next_date = Date.fromisoformat(response["nextDate"])
if next_date > requested_date:
requested_date = next_date
continue
day_showtimes = self._parse_showtimes(response.get("results") or [])
for page in range(2, (jmespath.search("pagination.totalPages", response) or 1) + 1):
response = self._client.get_showtimelist_by_theater_id(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"date_time": "2026-10-02T20:30:00.000000",
"movie": {
"actors": "Pauline Clément, Laurent Stocker, Julien Frison",
"countries": [
"France"
],
"directors": "Martin Darondeau, Bertrand Usclat",
"duration": "datetime.timedelta(seconds=4500)",
"genres": "Comédie",
"language": "Français",
"movie_id": 1000037046,
"original_title": "De la Comédie-Française",
"rating": 3.96,
"screen_format": "Numérique",
"synopsis": "Dans 3 heures, Nina dévoile sa première mise en scène à la Comédie-Française. Mais dans l’agitation des dernières répétitions, rien ne se passe comme prévu : retards, coups de stress, problèmes techniques et problèmes d’égo secouent la troupe. Pourtant, Nina n’a pas d’autre choix que d’aller jusqu’au bout car s’il y a bien une règle d’or à la Comédie-Française, c’est qu’on n’annule pas. Commence alors une course contre la montre pour sauver la représentation.",
"title": "De la Comédie-Française",
"year": 2026
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"address": "route de Troyes",
"city": "Chaource",
"name": "Ciné Ligue CA - Chaource (ex Collège A.Jamyn)",
"theater_id": "W1021",
"zipcode": "10210"
}
Loading
Loading