diff --git a/pyproject.toml b/pyproject.toml index 82d6f4c..2747161 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "comic_download" -version = "0.2.1" +version = "0.2.2" authors = [ {name = "Markil 3", email = "markil3@singlepilot.net"} ] diff --git a/setup.cfg b/setup.cfg index 37810f1..40cd6c5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = comic_download -version = 0.2.1 +version = 0.2.2 [options] package_dir= diff --git a/src/comic_download/dinosaur_comics.py b/src/comic_download/dinosaur_comics.py index 89a5845..8720eab 100644 --- a/src/comic_download/dinosaur_comics.py +++ b/src/comic_download/dinosaur_comics.py @@ -64,17 +64,18 @@ class DinosaurComic(Comic): self.strip_index = {} date_pat = re.compile(r'(\d+)(st|nd|rd|th)') for archive_month in archives: - link_el = archive_month.find("a") - if link_el: - parsed_index = urlparse(link_el["href"]) - identifier = int(parse_qs(parsed_index.query)["comic"][0]) - date_str = link_el.get_text() - date = datetime.datetime.strptime(date_pat.sub(r'\1', date_str), '%B %d, %Y').date() - self.strips.append({ - "identifier": identifier, - "date": date, - "description": link_el.next_sibling.get_text()[2:] - }) + for line_item in archive_month.find_all("li"): + link_el = line_item.find("a") + if link_el: + parsed_index = urlparse(link_el["href"]) + identifier = int(parse_qs(parsed_index.query)["comic"][0]) + date_str = link_el.get_text() + date = datetime.datetime.strptime(date_pat.sub(r'\1', date_str), '%B %d, %Y').date() + self.strips.append({ + "identifier": identifier, + "date": date, + "description": link_el.next_sibling.get_text()[2:] + }) self.strips.sort(key=lambda x: x["date"]) for i in range(len(self.strips)): self.strip_index[self.strips[i]["identifier"]] = i