Skip to content

Commit b45a3ef

Browse files
authored
Merge pull request #2619 from xantror/xantror/algoliaapi-enhancements
feat(AlgoliaAPI): add endowment parsing and unit conversion
2 parents a06523c + b98a099 commit b45a3ef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scrapers/AlgoliaAPI/AlgoliaAPI.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from py_common import graphql, log
1717
from py_common.deps import ensure_requirements
1818
from py_common.types import ScrapedGallery, ScrapedMovie, ScrapedPerformer, ScrapedScene
19-
from py_common.util import dig, guess_nationality, is_valid_url, scraper_args
19+
from py_common.util import dig, guess_nationality, feet_to_cm, lb_to_kg, is_valid_url, scraper_args
2020
ensure_requirements("algoliasearch", "bs4:beautifulsoup4", "requests")
2121

2222
from algoliasearch.search.client import SearchClientSync
@@ -191,9 +191,11 @@ def to_scraped_performer(performer_from_api: dict[str, Any], site: str) -> Scrap
191191
if alternate_names := dig(performer_from_api, "attributes", "alternate_names"):
192192
performer["aliases"] = alternate_names.strip()
193193
if height := dig(performer_from_api, "attributes", "height"):
194-
performer["height"] = height.strip()
194+
performer["height"] = feet_to_cm(height.strip())
195195
if weight := dig(performer_from_api, "attributes", "weight"):
196-
performer["weight"] = weight.strip()
196+
performer["weight"] = lb_to_kg(weight.strip())
197+
if endowment := dig(performer_from_api, "attributes", "endowment"):
198+
performer["penis_length"] = feet_to_cm("0'" + endowment.strip())
197199
if home := dig(performer_from_api, "attributes", "home"):
198200
performer["country"] = guess_nationality(home.strip())
199201
if performer_from_api.get("has_pictures") and (pictures := performer_from_api.get("pictures")):

0 commit comments

Comments
 (0)