Skip to content

Commit

Permalink
Add Directors, Producers and Get Background Images
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondpete committed Aug 9, 2023
1 parent 2c22ab0 commit 5ee2b18
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions Contents/Code/PAdatabaseActors.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
'Jenna Ross': ['Jenna J Ross', 'Jenna J. Ross'],
'Jennifer Bliss': ['Jenni Bliss', 'Jennifer Matthews'],
'Jenny Fer': ['Jenny Ferri'],
'Jerry Kovacs': ['Jerry Kovak'],
'Jessi Gold': ['Jaggie Gold', 'Jassie Gold'],
'Jessica Foxx': ['Jessica Blue', 'Jessica Cute'],
'Jewel De\'Nyle': ['Jewel De Nyle', 'Jewel DeNyle', 'Jewel Denyle'],
Expand Down
27 changes: 25 additions & 2 deletions Contents/Code/siteAdultEmpire.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,20 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
summary = ''
metadata.summary = summary

# Director(s)
directorElement = detailsPageElements.xpath('//div[./a[@name="cast"]]//li[./*[contains(., "Director")]]/a/text()')
for directorName in directorElement:
director = metadata.directors.new()
name = directorName.strip()
director.name = name

# Producer(s)
producerElement = detailsPageElements.xpath('//div[./a[@name="cast"]]//li[./*[contains(., "Producer")]]/text()')
for producerName in producerElement:
producer = metadata.producers.new()
name = producerName.strip()
producer.name = name

# Studio
try:
studio = detailsPageElements.xpath('//li[contains(., "Studio:")]/a/text()')[0].strip()
Expand All @@ -241,11 +255,13 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):

# Tagline and Collection(s)
metadata.collections.clear()
metadata.collections.add(studio)
try:
tagline = re.sub(r'\(.*\)', '', detailsPageElements.xpath('//h2/a[@label="Series"]/text()')[0].strip().split('"')[1]).strip()
tagline = PAutils.parseTitle(tagline, siteNum)

metadata.tagline = tagline
metadata.collections.add(tagline)
metadata.collections.add(studio)
except:
if splitScene:
metadata.collections.add(PAutils.parseTitle(detailsPageElements.xpath('//h1/text()')[0], siteNum).strip())
Expand Down Expand Up @@ -293,16 +309,23 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):

# Posters
xpaths = [
'//div[@class="boxcover-container"]/a/img/@src'
'//div[@class="boxcover-container"]/a/img/@src',
'//div[@class="boxcover-container"]/a/@href'
]

try:
for xpath in xpaths:
art.append(detailsPageElements.xpath(xpath)[0])
except:
pass

try:
if splitScene:
splitScenes = '//div[@class="row"][.//div[@class="row"]][.//a[@rel="scenescreenshots"]][%d]//a/@href' % (sceneIndex + 1)
art.extend(detailsPageElements.xpath(splitScenes))
else:
scenes = '//div[@class="row"][.//div[@class="row"]][.//a[@rel="scenescreenshots"]]//div[@class="row"]//a/@href'
art.extend(detailsPageElements.xpath(scenes))
except:
pass

Expand Down

0 comments on commit 5ee2b18

Please sign in to comment.