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
100 changes: 50 additions & 50 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,53 +71,53 @@ jobs:
name: dist
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Get Tag
id: tag
uses: olegtarasov/get-tag@v2.1.1
- name: Clean CHANGELOG.md
run: |
touch CHANGELOG.md.tmp
npm install -g prettier
prettier --parser markdown --tab-width 4 --prose-wrap never CHANGELOG.md > CHANGELOG.md.tmp
cat CHANGELOG.md.tmp > CHANGELOG.md
- name: Build Release
id: release
uses: MatteoCampinoti94/changelog-to-release@v1.0.2
with:
version-name: ${{ steps.tag.outputs.tag }}
- name: Build Release File
env:
TAG: ${{ steps.tag.outputs.tag }}
RELEASE: ${{ steps.release.outputs.body }}
run: |
touch RELEASE.md
PREVIOUS_TAG="$(git tag -l --sort=-version:refname | head -2 | tail -1)"
printf "%s\n" "$RELEASE" > RELEASE.md
printf "\n## 🔗 Links\n" >> RELEASE.md
printf "\n* %s" "PyPi release: https://pypi.org/project/${GITHUB_REPOSITORY#*/}/${TAG#v}" >> RELEASE.md
printf "\n* %s" "Full changelog: https://github.com/$GITHUB_REPOSITORY/compare/$PREVIOUS_TAG...$TAG" >> RELEASE.md
cat RELEASE.md
printf "\n\n## Dist Files\n"
ls -l dist || echo " no files"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.tag.outputs.tag }}
name: ${{ steps.release.outputs.title }}
body_path: RELEASE.md
files: |
dist/*
# release:
# name: Release
# runs-on: ubuntu-latest
# needs: publish
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Get dist
# uses: actions/download-artifact@v4
# with:
# name: dist
# path: dist
# - name: Get Tag
# id: tag
# uses: olegtarasov/get-tag@v2.1.1
# - name: Clean CHANGELOG.md
# run: |
# touch CHANGELOG.md.tmp
# npm install -g prettier
# prettier --parser markdown --tab-width 4 --prose-wrap never CHANGELOG.md > CHANGELOG.md.tmp
# cat CHANGELOG.md.tmp > CHANGELOG.md
# - name: Build Release
# id: release
# uses: MatteoCampinoti94/changelog-to-release@v1.0.2
# with:
# version-name: ${{ steps.tag.outputs.tag }}
# - name: Build Release File
# env:
# TAG: ${{ steps.tag.outputs.tag }}
# RELEASE: ${{ steps.release.outputs.body }}
# run: |
# touch RELEASE.md
# PREVIOUS_TAG="$(git tag -l --sort=-version:refname | head -2 | tail -1)"
# printf "%s\n" "$RELEASE" > RELEASE.md
# printf "\n## 🔗 Links\n" >> RELEASE.md
# printf "\n* %s" "PyPi release: https://pypi.org/project/${GITHUB_REPOSITORY#*/}/${TAG#v}" >> RELEASE.md
# printf "\n* %s" "Full changelog: https://github.com/$GITHUB_REPOSITORY/compare/$PREVIOUS_TAG...$TAG" >> RELEASE.md
# cat RELEASE.md
# printf "\n\n## Dist Files\n"
# ls -l dist || echo " no files"
# - name: Create Release
# uses: softprops/action-gh-release@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag_name: ${{ steps.tag.outputs.tag }}
# name: ${{ steps.release.outputs.title }}
# body_path: RELEASE.md
# files: |
# dist/*
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v3.11.10

### Changes

* Remove gender parsing and set the `Submission.gender` property to `None`
* See [June 18th, 2025- Hardware and Drop Down Updates](https://www.furaffinity.net/journal/11160892)

### Fixes

* Allow "^" characters in username URL names

## v3.11.9

### Fixes
Expand All @@ -25,8 +36,8 @@
### Fixes

* Fix next page of favorites
* The selector path to the "Next" button had changed
* The presence of the button is now tested
* The selector path to the "Next" button had changed
* The presence of the button is now tested

## v3.11.5

Expand Down
2 changes: 1 addition & 1 deletion faapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.11.9"
__version__ = "3.11.10"
17 changes: 7 additions & 10 deletions faapi/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def check_page_raise(page: BeautifulSoup) -> None:


def username_url(username: str) -> str:
return sub(r"[^a-z\d.~`\[\]-]", "", username.lower())
return sub(r"[^\^a-z\d.~`\[\]-]", "", username.lower())


def inner_html(tag: Tag) -> str:
Expand Down Expand Up @@ -512,8 +512,7 @@ def parse_submission_page(sub_page: BeautifulSoup) -> dict[str, Any]:

tag_category1: Optional[Tag] = tag_info.select_one("span.category-name")
tag_category2: Optional[Tag] = tag_info.select_one("span.type-name")
tag_species: Optional[Tag] = (info_spans := tag_info.select("span"))[bool(tag_category1) + bool(tag_category2)]
tag_gender: Optional[Tag] = info_spans[1 + bool(tag_category1) + bool(tag_category2)]
tag_species: Optional[Tag] = tag_info.select("span")[bool(tag_category1) + bool(tag_category2)]
tag_description: Optional[Tag] = sub_page.select_one("div.submission-description")
tag_folder: Optional[Tag] = sub_page.select_one("a.button[href^='/scraps/'],a.button[href^='/gallery/']")
tag_file_url: Optional[Tag] = sub_page.select_one("div.download a")
Expand All @@ -532,7 +531,6 @@ def parse_submission_page(sub_page: BeautifulSoup) -> dict[str, Any]:
assert tag_type is not None, _raise_exception(ParsingError("Missing type tag"))
assert tag_fav is not None, _raise_exception(ParsingError("Missing fav tag"))
assert tag_species is not None, _raise_exception(ParsingError("Missing species tag"))
assert tag_gender is not None, _raise_exception(ParsingError("Missing gender tag"))
assert tag_description is not None, _raise_exception(ParsingError("Missing description tag"))
assert tag_folder is not None, _raise_exception(ParsingError("Missing folder tag"))
assert tag_file_url is not None, _raise_exception(ParsingError("Missing file URL tag"))
Expand All @@ -556,7 +554,6 @@ def parse_submission_page(sub_page: BeautifulSoup) -> dict[str, Any]:
category += " / " + tag_category2.text.strip()
category.strip()
species: str = tag_species.text.strip()
gender: str = tag_gender.text.strip()
rating: str = tag_rating.text.strip()
views: int = int(tag_views.text.strip())
comment_count: int = int(tag_comment_count.text.strip())
Expand All @@ -577,11 +574,11 @@ def parse_submission_page(sub_page: BeautifulSoup) -> dict[str, Any]:
thumbnail_url = f"{thumbnail_url.rsplit('/', 1)[0]}/{quote(thumbnail_url.rsplit('/', 1)[1])}" \
if thumbnail_url else ""
prev_sub: Optional[int] = int(
get_attr(tag_prev, "href").split("/")[-2]
) if tag_prev and tag_prev.text.lower() == "prev" else None
get_attr(tag_prev, "href").strip("/").split("/")[-1]
) if tag_prev and tag_prev.text.lower() == "newer" else None
next_sub: Optional[int] = int(
get_attr(tag_next, "href").split("/")[-2]
) if tag_next and tag_next.text.lower() == "next" else None
get_attr(tag_next, "href").strip("/").split("/")[-1]
) if tag_next and tag_next.text.lower() == "older" else None
fav_link: Optional[str] = f"{root}{href}" if (href := get_attr(tag_fav, "href")).startswith("/fav/") else None
unfav_link: Optional[str] = f"{root}{href}" if (href := get_attr(tag_fav, "href")).startswith("/unfav/") else None
user_folders: list[tuple[str, str, str]] = []
Expand All @@ -605,7 +602,7 @@ def parse_submission_page(sub_page: BeautifulSoup) -> dict[str, Any]:
"tags": tags,
"category": category,
"species": species,
"gender": gender,
"gender": None,
"rating": rating,
"views": views,
"comment_count": comment_count,
Expand Down
2 changes: 1 addition & 1 deletion faapi/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(self, submission_page: Optional[BeautifulSoup] = None):
self.tags: list[str] = []
self.category: str = ""
self.species: str = ""
self.gender: str = ""
self.gender: Optional[str] = None
self.rating: str = ""
self.stats: SubmissionStats = SubmissionStats(0, 0, 0)
self.type: str = ""
Expand Down
Loading