diff --git a/src/letsrolld/film.py b/src/letsrolld/film.py index 1f8d3c1..156e53f 100644 --- a/src/letsrolld/film.py +++ b/src/letsrolld/film.py @@ -142,12 +142,16 @@ def jw_url(self): return None return link - # TODO: extract runtime from letterboxd if quickwatch is not available @functools.cached_property def runtime(self): - if self.jw is None: - return None - return self.jw.runtime_minutes + # first, try (structured) justwatch data + if self.jw is not None: + return self.jw.runtime_minutes + # fall back to letterboxd html + for p in self.soup.find_all("p", class_="text-link text-footer"): + match = re.search(r"(\d+)\smins", p.text) + if match: + return int(match.group(1)) @functools.cached_property def _full_title(self):