mirror of
https://github.com/stashapp/CommunityScrapers.git
synced 2025-12-11 03:08:29 -06:00
Add studio mapping for Trans Angels
This commit is contained in:
parent
3469fdde9c
commit
f93801c92a
60
scrapers/TransAngels/TransAngels.py
Normal file
60
scrapers/TransAngels/TransAngels.py
Normal file
@ -0,0 +1,60 @@
|
||||
import json
|
||||
import sys
|
||||
from typing import Any
|
||||
from py_common import log
|
||||
from py_common.util import replace_all
|
||||
from AyloAPI.scrape import (
|
||||
gallery_from_url,
|
||||
scraper_args,
|
||||
scene_from_url,
|
||||
scene_search,
|
||||
scene_from_fragment,
|
||||
performer_from_url,
|
||||
performer_from_fragment,
|
||||
performer_search,
|
||||
movie_from_url,
|
||||
)
|
||||
|
||||
studio_map = {
|
||||
"TransAngels": "Trans Angels",
|
||||
}
|
||||
|
||||
|
||||
def transangels(obj: Any, _) -> Any:
|
||||
return replace_all(obj, "name", replacement=lambda x: studio_map.get(x, x))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
domains = [
|
||||
"transangels",
|
||||
"transharder",
|
||||
]
|
||||
op, args = scraper_args()
|
||||
result = None
|
||||
|
||||
match op, args:
|
||||
case "gallery-by-url" | "gallery-by-fragment", {"url": url} if url:
|
||||
result = gallery_from_url(url, postprocess=transangels)
|
||||
case "scene-by-url", {"url": url} if url:
|
||||
result = scene_from_url(url, postprocess=transangels)
|
||||
case "scene-by-name", {"name": name} if name:
|
||||
result = scene_search(name, search_domains=domains, postprocess=transangels)
|
||||
case "scene-by-fragment" | "scene-by-query-fragment", args:
|
||||
result = scene_from_fragment(
|
||||
args, search_domains=domains, postprocess=transangels
|
||||
)
|
||||
case "performer-by-url", {"url": url}:
|
||||
result = performer_from_url(url, postprocess=transangels)
|
||||
case "performer-by-fragment", args:
|
||||
result = performer_from_fragment(args)
|
||||
case "performer-by-name", {"name": name} if name:
|
||||
result = performer_search(
|
||||
name, search_domains=domains, postprocess=transangels
|
||||
)
|
||||
case "movie-by-url", {"url": url} if url:
|
||||
result = movie_from_url(url, postprocess=transangels)
|
||||
case _:
|
||||
log.error(f"Operation: {op}, arguments: {json.dumps(args)}")
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps(result))
|
||||
@ -1,81 +1,78 @@
|
||||
name: TransAngels
|
||||
name: Trans Angels
|
||||
# requires: py_common, AyloAPI
|
||||
# scrapes: TransAngels, TransHarder
|
||||
# scrapes: Trans Angels, TransHarder
|
||||
galleryByURL:
|
||||
- action: script
|
||||
url:
|
||||
- transangels.com/scene/
|
||||
- transangelsnetwork.com/scene/
|
||||
- transharder.com/scene/
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- TransAngels.py
|
||||
- gallery-by-url
|
||||
sceneByURL:
|
||||
- action: script
|
||||
url:
|
||||
- transangels.com/scene/
|
||||
- transangelsnetwork.com/scene/
|
||||
- transharder.com/scene/
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- TransAngels.py
|
||||
- scene-by-url
|
||||
sceneByFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- transangels
|
||||
- transharder
|
||||
- TransAngels.py
|
||||
- scene-by-fragment
|
||||
sceneByName:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- transangels
|
||||
- transharder
|
||||
- TransAngels.py
|
||||
- scene-by-name
|
||||
sceneByQueryFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- transangels
|
||||
- transharder
|
||||
- TransAngels.py
|
||||
- scene-by-query-fragment
|
||||
performerByName:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- transangels
|
||||
- transharder
|
||||
- TransAngels.py
|
||||
- performer-by-name
|
||||
performerByURL:
|
||||
- action: script
|
||||
url:
|
||||
- transangels.com/model/
|
||||
- transangelsnetwork.com/model/
|
||||
- transharder.com/model/
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- TransAngels.py
|
||||
- performer-by-url
|
||||
performerByFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- TransAngels.py
|
||||
- performer-by-fragment
|
||||
movieByURL:
|
||||
- action: script
|
||||
url:
|
||||
- transangels.com/movie/
|
||||
- transangelsnetwork.com/movie/
|
||||
- transharder.com/movie/
|
||||
# Since scenes link to the movie we can scrape movies from scenes
|
||||
- transangels.com/scene/
|
||||
- transangelsnetwork.com/scene/
|
||||
- transharder.com/scene/
|
||||
script:
|
||||
- python
|
||||
- ../AyloAPI/scrape.py
|
||||
- TransAngels.py
|
||||
- movie-by-url
|
||||
# Last Updated January 13, 2024
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user