stash
This commit is contained in:
83
stash/config/scrapers/community/MetroHD/MetroHD.py
Normal file
83
stash/config/scrapers/community/MetroHD/MetroHD.py
Normal file
@@ -0,0 +1,83 @@
|
||||
import json
|
||||
import sys
|
||||
from typing import Any
|
||||
from py_common import log
|
||||
from py_common.util import dig, replace_all, replace_at
|
||||
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 = {
|
||||
"Family Hook Ups": "Family Hookups",
|
||||
"Metro": "Metro HD",
|
||||
}
|
||||
|
||||
|
||||
def metrohd(obj: Any, _) -> Any:
|
||||
replacement = None
|
||||
match dig(obj, "studio", "name"):
|
||||
case "Deviant Hardcore":
|
||||
replacement = "devianthardcore.com"
|
||||
case "Family Hook Ups":
|
||||
replacement = "familyhookups.com"
|
||||
case "Girl Grind":
|
||||
replacement = "girlgrind.com"
|
||||
case "Kinky Spa":
|
||||
replacement = "kinkyspa.com"
|
||||
case "She Will Cheat":
|
||||
replacement = "shewillcheat.com"
|
||||
case _:
|
||||
replacement = "metrohd.com"
|
||||
|
||||
# Replace the studio name in all URLs: even if there's no specific studio,
|
||||
# metro.com is wrong and needs to be replaced with metrohd.com
|
||||
fixed = replace_all(obj, "url", lambda x: x.replace("metro.com", replacement))
|
||||
|
||||
fixed = replace_all(fixed, "name", replacement=lambda x: studio_map.get(x, x))
|
||||
return fixed
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
domains = [
|
||||
"devianthardcore",
|
||||
"familyhookups",
|
||||
"girlgrind",
|
||||
"kinkyspa",
|
||||
"shewillcheat",
|
||||
"metrohd",
|
||||
]
|
||||
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=metrohd)
|
||||
case "scene-by-url", {"url": url} if url:
|
||||
result = scene_from_url(url, postprocess=metrohd)
|
||||
case "scene-by-name", {"name": name} if name:
|
||||
result = scene_search(name, search_domains=domains, postprocess=metrohd)
|
||||
case "scene-by-fragment" | "scene-by-query-fragment", args:
|
||||
result = scene_from_fragment(
|
||||
args, search_domains=domains, postprocess=metrohd
|
||||
)
|
||||
case "performer-by-url", {"url": url}:
|
||||
result = performer_from_url(url, postprocess=metrohd)
|
||||
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=metrohd)
|
||||
case "movie-by-url", {"url": url} if url:
|
||||
result = movie_from_url(url, postprocess=metrohd)
|
||||
case _:
|
||||
log.error(f"Operation: {op}, arguments: {json.dumps(args)}")
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps(result))
|
||||
92
stash/config/scrapers/community/MetroHD/MetroHD.yml
Normal file
92
stash/config/scrapers/community/MetroHD/MetroHD.yml
Normal file
@@ -0,0 +1,92 @@
|
||||
name: Metro HD
|
||||
# requires: py_common, AyloAPI
|
||||
# scrapes: Metro HD, Deviant Hardcore, Girl Grind, Kinky Spa, She Will Cheat, Family Hookups
|
||||
galleryByURL:
|
||||
- action: script
|
||||
url:
|
||||
- metrohd.com/scene/
|
||||
- devianthardcore.com/scene/
|
||||
- familyhookups.com/scene/
|
||||
- girlgrind.com/scene/
|
||||
- kinkyspa.com/scene/
|
||||
- shewillcheat.com/scene/
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- gallery-by-url
|
||||
galleryByFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- gallery-by-fragment
|
||||
sceneByURL:
|
||||
- action: script
|
||||
url:
|
||||
- metrohd.com/scene/
|
||||
- devianthardcore.com/scene/
|
||||
- familyhookups.com/scene/
|
||||
- girlgrind.com/scene/
|
||||
- kinkyspa.com/scene/
|
||||
- shewillcheat.com/scene/
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- scene-by-url
|
||||
sceneByFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- scene-by-fragment
|
||||
sceneByName:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- scene-by-name
|
||||
sceneByQueryFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- scene-by-query-fragment
|
||||
performerByName:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- performer-by-name
|
||||
performerByURL:
|
||||
- action: script
|
||||
url:
|
||||
- metrohd.com/model/
|
||||
- devianthardcore.com/model/
|
||||
- familyhookups.com/model/
|
||||
- girlgrind.com/model/
|
||||
- kinkyspa.com/model/
|
||||
- shewillcheat.com/model/
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- performer-by-url
|
||||
performerByFragment:
|
||||
action: script
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- performer-by-fragment
|
||||
movieByURL:
|
||||
- action: script
|
||||
url:
|
||||
- metrohd.com/movie/
|
||||
- devianthardcore.com/movie/
|
||||
- familyhookups.com/movie/
|
||||
- girlgrind.com/movie/
|
||||
- kinkyspa.com/movie/
|
||||
- shewillcheat.com/movie/
|
||||
script:
|
||||
- python
|
||||
- MetroHD.py
|
||||
- movie-by-url
|
||||
# Last Updated January 14, 2024
|
||||
10
stash/config/scrapers/community/MetroHD/manifest
Executable file
10
stash/config/scrapers/community/MetroHD/manifest
Executable file
@@ -0,0 +1,10 @@
|
||||
id: MetroHD
|
||||
name: Metro HD
|
||||
metadata: {}
|
||||
version: 64a5a66
|
||||
date: "2024-02-16 23:32:51"
|
||||
requires: []
|
||||
source_repository: https://stashapp.github.io/CommunityScrapers/stable/index.yml
|
||||
files:
|
||||
- MetroHD.yml
|
||||
- MetroHD.py
|
||||
Reference in New Issue
Block a user