From 07545c614cd52f0d6e584f26c5843342b1b7ef55 Mon Sep 17 00:00:00 2001 From: diamondpete <87245367+diamondpete@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:47:56 -0400 Subject: [PATCH 1/2] ScoreGroup/Fix Summary, Genres, Actor Photos and Title --- Contents/Code/networkScoreGroup.py | 47 ++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/Contents/Code/networkScoreGroup.py b/Contents/Code/networkScoreGroup.py index ac4dc9ee5..216e1ce6a 100644 --- a/Contents/Code/networkScoreGroup.py +++ b/Contents/Code/networkScoreGroup.py @@ -99,18 +99,18 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art): detailsPageElements = HTML.ElementFromString(req.text) # Title - metadata.title = PAutils.parseTitle(detailsPageElements.xpath('//h1')[0].text_content().strip(), siteNum) + title = detailsPageElements.xpath('//h1')[0].text_content().strip() + if not title: + actors = detailsPageElements.xpath('//div/span[@class="value"]/a/text()') + if len(actors) > 1: + title = ' and '.join(actors) + elif actors: + title = actors[0] + metadata.title = PAutils.parseTitle(title, siteNum).replace('Coming Soon:', '').strip() # Summary - summary_xpaths = [ - '//div[@class="p-desc"]', - '//div[contains(@class, "desc")]' - ] - - for xpath in summary_xpaths: - for summary in detailsPageElements.xpath(xpath): - metadata.summary = summary.text_content().replace('Read More ยป', '').strip() - break + summary = detailsPageElements.xpath('//div[contains(@class, "p-desc")]/text()') + metadata.summary = '\n'.join([x for x in summary if x and x != ' ']).strip() # Studio metadata.studio = 'Score Group' @@ -134,22 +134,37 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art): metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year + # Genres + genre_xpaths = [ + '//div[@class="mb-3"]/a', + '//div[contains(@class, "desc")]//a[contains(@href, "tag") or contains(@href, "category")]' + ] + + for xpath in genre_xpaths: + for genreLink in detailsPageElements.xpath(xpath): + genreName = genreLink.text_content().strip() + + movieGenres.addGenre(genreName) + # Actor(s) for actorLink in detailsPageElements.xpath('//div/span[@class="value"]/a'): actorName = actorLink.text_content().strip() actorPhotoURL = '' + try: + modelURL = actorLink.xpath('.//@href')[0].split('?')[0] + req = PAutils.HTTPRequest(modelURL) + modelPageElements = HTML.ElementFromString(req.text) + + actorPhotoURL = modelPageElements.xpath('//div[@class="item-img pos-rel"]//img/@src')[0] + except: + pass + movieActors.addActor(actorName, actorPhotoURL) if siteNum == 1344: movieActors.addActor('Christy Marks', '') - # Genres - for genreLink in detailsPageElements.xpath('//div[@class="mb-3"]/a'): - genreName = genreLink.text_content().strip() - - movieGenres.addGenre(genreName) - # Posters/Background match = re.search(r'posterImage: \'(.*)\'', req.text) if match: From a5edb191472f91a1e968c020f755f8274f011442 Mon Sep 17 00:00:00 2001 From: diamondpete <87245367+diamondpete@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:48:12 -0400 Subject: [PATCH 2/2] ScoreGroup/Actor Corrections --- Contents/Code/PAdatabaseActors.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Contents/Code/PAdatabaseActors.py b/Contents/Code/PAdatabaseActors.py index 22d245ded..78af439ac 100644 --- a/Contents/Code/PAdatabaseActors.py +++ b/Contents/Code/PAdatabaseActors.py @@ -5641,8 +5641,10 @@ 'Luna Amor': ['Alexya'], 'Luna Fae': ['Luna'], 'Mella Megan': ['Mella'], + 'Petra Vismekova': ['Petra'], 'Reese Robbins': ['Reese'], 'Siri Dahl': ['Siri'], + 'Steve Hooper': ['Bailey Lincoln'], }, 57: { # Desperate Amateurs 'Stephie Staar': ['Stephie'],