diff --git a/check.py b/check.py index 7630216..5d4c234 100755 --- a/check.py +++ b/check.py @@ -76,7 +76,6 @@ not_here_list = [ "This page does not exist yet", "404 Not Found", "500 Internal Server Error", - "500: Internal Server Error", "Test Page for the Apache HTTP Server", "Site not found · GitHub Pages", "504: Gateway time-out", @@ -186,24 +185,21 @@ class Conference: @property def url(self) -> str: """Conference URL.""" - return self.build_url(year=self.year) - - def build_url(self, year: int) -> str: - """Build conference URL.""" - return self.src_url.format(year=year, two_digit_year=year % 2000) + return self.src_url.format(year=self.year) @property def past_url(self) -> str: """URL for previous year.""" - return self.build_url(year=self.year - 1) + return self.src_url.format(year=self.year - 1) def check(self) -> tuple[bool, str, str | None]: """Check if conference is live.""" no_dot = {"bsideskbh.dk", "pif.camp"} - url = self.url - session = s if all(hostname not in url for hostname in no_dot) else s_no_dot + session = ( + s if all(hostname not in self.url for hostname in no_dot) else s_no_dot + ) try: - r = session.get(url) + r = session.get(self.url) except requests.exceptions.ConnectionError: return (False, "connection refused", None) @@ -232,7 +228,7 @@ class Conference: def check_web_site(self) -> bool: """Check if an individual web site is live.""" - assert "{year}" in self.src_url or "{two_digit_year}" in self.src_url + assert "{year}" in self.src_url live, msg, redirect_to_url = self.check() if not live: return False