Skip to content

Commit

Permalink
JavLibrary_python: add Label parsing in advance
Browse files Browse the repository at this point in the history
Stash doesn't support assigning Label yet, but why not implement it in advance?
See JAV progress in Stash at stashapp/stash#3065
  • Loading branch information
YurikaL committed Dec 6, 2022
1 parent fd4b470 commit 133be97
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scrapers/JavLibrary_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
DEBUG_MODE = False
# We can't add movie image atm in the same time as Scene
STASH_SUPPORTED = False
# Stash isn't support Labels yet
STASH_SUPPORT_LABELS = False
# Tags you don't want to scrape
IGNORE_TAGS = [
"Features Actress", "Hi-Def", "Beautiful Girl", "Blu-ray",
Expand Down Expand Up @@ -600,6 +602,9 @@ def th_imageto_base64(imageurl, typevar):
jav_xPath[
"studio"] = '//td[@class="header" and text()="Maker:"]'\
'/following-sibling::td/span[@class="maker"]/a/text()'
jav_xPath[
"label"] = '//td[@class="header" and text()="Label:"]'\
'/following-sibling::td/span[@class="label"]/a/text()'
jav_xPath["image"] = '//div[@id="video_jacket"]/img/@src'
jav_xPath["r18"] = '//a[text()="purchasing HERE"]/@href'

Expand Down Expand Up @@ -690,6 +695,8 @@ def th_imageto_base64(imageurl, typevar):
jav_result["title"][0])).lstrip()
if jav_result.get("director"):
jav_result["director"] = jav_result["director"][0]
if jav_result.get("label"):
jav_result["label"] = jav_result["label"][0]
if jav_result.get("performers_url") and IGNORE_ALIASES is False:
javlibrary_aliases_thread = threading.Thread(
target=th_request_perfpage,
Expand Down Expand Up @@ -808,6 +815,10 @@ def th_imageto_base64(imageurl, typevar):
if jav_result.get('studio'):
scrape['studio']['name'] = jav_result['studio'][0]

# Not supported by Stash yet
if jav_result.get('label') and STASH_SUPPORT_LABELS:
scrape['label']['name'] = jav_result['label']

# Performer - Javlibrary > R18
if r18_result.get('performers'):
scrape['performers'] = buildlist_tagperf(r18_result['performers'])
Expand Down

0 comments on commit 133be97

Please sign in to comment.