Skip to content

Commit

Permalink
Scrape correct gender for trans performers on IAFD
Browse files Browse the repository at this point in the history
This closes #1524
  • Loading branch information
Maista6969 committed Dec 18, 2023
1 parent 1de471c commit b612886
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scrapers/IAFD/IAFD.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,16 @@ def performer_url(tree):


def performer_gender(tree):
def prepend_transgender(gender: str):
perf_id = next(
iter(tree.xpath('//form[@id="correct"]/input[@name="PerfID"]/@value')), ""
)
trans = "Transgender " if perf_id.endswith("_ts") else ""
return trans + map_gender(gender)

return maybe(
tree.xpath('//form[@id="correct"]/input[@name="Gender"]/@value'), map_gender
tree.xpath('//form[@id="correct"]/input[@name="Gender"]/@value'),
prepend_transgender,
)


Expand Down

0 comments on commit b612886

Please sign in to comment.