diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c580e..7aea9ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v3.12.1 + +### Fixes + +* Fix error when parsing journals lists when one or more journals was not rated general + ## v3.12.0 ### New Features diff --git a/faapi/__version__.py b/faapi/__version__.py index d1a7f1e..555cdb2 100644 --- a/faapi/__version__.py +++ b/faapi/__version__.py @@ -1 +1 @@ -__version__ = "3.12.0" +__version__ = "3.12.1" diff --git a/faapi/parse.py b/faapi/parse.py index b0b605e..6a41653 100644 --- a/faapi/parse.py +++ b/faapi/parse.py @@ -20,6 +20,7 @@ from .connection import root from .exceptions import _raise_exception +from .exceptions import ClassicTheme from .exceptions import DisabledAccount from .exceptions import NonePage from .exceptions import NotFound @@ -27,7 +28,6 @@ from .exceptions import NoTitle from .exceptions import ParsingError from .exceptions import ServerError -from .exceptions import ClassicTheme relative_url: Pattern = re_compile(r"^(?:https?://(?:www\.)?furaffinity\.net)?(.*)") mentions_regexp: Pattern = re_compile(r"^(?:(?:https?://)?(?:www\.)?furaffinity\.net)?/user/([^/#]+).*$") @@ -358,7 +358,11 @@ def parse_loggedin_user(page: BeautifulSoup) -> Optional[str]: def parse_journal_section(section_tag: Tag) -> dict[str, Any]: id_: int = int(section_tag.attrs.get("id", "00000")[4:]) tag_title: Optional[Tag] = section_tag.select_one("h2") - tag_rating: Optional[Tag] = section_tag.select_one("span.c-contentRating--general") + tag_rating: Optional[Tag] = section_tag.select_one( + "span.c-contentRating--general" + ",span.c-contentRating--adult" + ",span.c-contentRating--mature" + ) tag_date: Optional[Tag] = section_tag.select_one("div.section-header span.popup_date") tag_content: Optional[Tag] = section_tag.select_one("div.journal-body") tag_comments: Optional[Tag] = section_tag.select_one("div.section-footer > a > span") diff --git a/pyproject.toml b/pyproject.toml index cd2eda6..0cbefd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "faapi" -version = "3.12.0" +version = "3.12.1" description = "Python module to implement API-like functionality for the FurAffinity.net website." authors = ["Matteo Campinoti "] license = "EUPL-1.2"