Skip to content

Commit

Permalink
Add proper domain handling for Brazzers VR
Browse files Browse the repository at this point in the history
  • Loading branch information
Maista6969 committed Dec 18, 2024
1 parent bab466c commit 20f32c9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scrapers/Brazzers/Brazzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@
studio_map = {
"JugFuckers": "Jug Fuckers",
"Shes Gonna Squirt": "She's Gonna Squirt",
"zzvr": "Brazzers VR",
}


def brazzers(obj: Any, _) -> Any:
def brazzers(obj: Any, api_result: Any) -> Any:
# Brazzers still hosts all of their VR content on a separate domain
domain = "brazzersvr.com" if dig(api_result, "isVR") else "brazzers.com"

# All brazzers URLs use /video/ instead of the standard /scene/
# and /pornstar/ instead of the standard /model
fixed = replace_all(
obj,
"url",
lambda x: x.replace("/scene/", "/video/").replace("/model/", "/pornstar/"),
lambda x: x.replace("/scene/", "/video/")
.replace("/model/", "/pornstar/")
.replace("brazzers.com", domain),
)
fixed = replace_all(
obj,
fixed,
"urls",
lambda x: x.replace("/scene/", "/video/").replace("/model/", "/pornstar/"),
lambda x: x.replace("/scene/", "/video/")
.replace("/model/", "/pornstar/")
.replace("brazzers.com", domain),
)

# Rename certain studios according to the map
Expand Down

0 comments on commit 20f32c9

Please sign in to comment.