def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = PAutils.Decode(metadata_id[2]) # Summary metadata.summary = detailsPageElements.xpath('//div[@class="container text-center"]//h2')[0].text_content().strip() # Studio metadata.studio = 'Cumbizz' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//span[@class="label label-primary"]/a'): genreName = genreLink.text_content().strip().lower() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath('//div[@class="breadcrumbs"]/a'): actorName = str(actorLink.text_content().strip()) actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = [ '//section[@class="har_section har_image_bck har_wht_txt har_fixed"]/@data-image', '//img[@class="vidgal unos"]/@src', '//img[@class="vidgal dos"]/@src', '//img[@class="vidgal tres"]/@src', '//img[@class="vidgal quatros"]/@src', ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteID, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteID) + sceneURL sceneDate = metadata_id[2] req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//span[@class="title_bar_hilite"]')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath('//span[@class="update_description"]')[0].text_content().strip() # Studio metadata.studio = 'Jules Jordan' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteID) metadata.tagline = tagline metadata.collections.add(tagline) try: dvdName = detailsPageElements.xpath('//span[@class="update_dvds"]')[0].text_content().replace('Movie:', '').strip() metadata.collections.add(dvdName) except: pass # Release Date if sceneDate: date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//span[@class="update_tags"]/a'): genreName = genreLink.text_content().strip().lower() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() if PAsearchSites.getSearchSiteName(siteID) == "GirlGirl": actors = detailsPageElements.xpath('//div[@class="item"]/span/div/a') else: actors = detailsPageElements.xpath('//div[@class="backgroundcolor_info"]/span[@class="update_models"]/a') if actors: for actorLink in actors: actorName = str(actorLink.text_content().strip()) actorPhotoURL = '' actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) try: actorPhotoURL = actorPage.xpath('//img[@class="model_bio_thumb stdimage thumbs target"]/@src0_3x')[0] if 'http' not in actorPhotoURL: actorPhotoURL = PAsearchSites.getSearchBaseURL(siteID) + actorPhotoURL except: pass movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] try: bigScript = detailsPageElements.xpath('//script[contains(text(), "df_movie")]')[0].text_content() alpha = bigScript.find('useimage = "') + 12 omega = bigScript.find('";', alpha) background = bigScript[alpha:omega] if 'http' not in background: background = PAsearchSites.getSearchBaseURL(siteID) + background art.append(background) except: pass # Slideshow of images from the Search page try: bigScript = detailsPageElements.xpath('//script[contains(text(), "df_movie")]')[0].text_content() alpha = bigScript.find('setid:"') + 7 omega = bigScript.find('",', alpha) setID = bigScript[alpha:omega] req = PAutils.HTTPRequest(PAsearchSites.getSearchSearchURL(siteID) + urllib.quote(metadata.title)) searchPageElements = HTML.ElementFromString(req.text) posterUrl = searchPageElements.xpath('//img[@id="set-target-%s"]/@src' % setID)[0] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteID) + posterUrl art.append(posterUrl) for i in range(0, 7): try: posterUrl = searchPageElements.xpath('//img[@id="set-target-%s"]/@src%d_1x' % (setID, i))[0] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteID) + posterUrl art.append(posterUrl) except: pass except: pass # Photos page try: photoPageURL = detailsPageElements.xpath('//div[@class="cell content_tab"]/a[text()="Photos"]')[0].get('href') req = PAutils.HTTPRequest(photoPageURL) photoPageElements = HTML.ElementFromString(req.text) bigScript = photoPageElements.xpath('//script[contains(text(),"var ptx")]')[0].text_content() ptx1600starts = bigScript.find('1600') ptx1600ends = bigScript.find('togglestatus', ptx1600starts) ptx1600 = bigScript[ptx1600starts:ptx1600ends] photos = [] imageCount = ptx1600.count('ptx["1600"][') for i in range(1, imageCount + 1): alpha = ptx1600.find('{src: "', omega) + 7 omega = ptx1600.find('"', alpha) posterUrl = ptx1600[alpha:omega] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteID) + posterUrl photos.append(posterUrl) for x in range(10): art.append(photos[random.randint(1, imageCount)]) except: pass # Vidcaps page try: capsPageURL = detailsPageElements.xpath('//div[@class="cell content_tab"]/a[text()="Caps"]')[0].get('href') req = PAutils.HTTPRequest(capsPageURL) capsPageElements = HTML.ElementFromString(req.text) bigScript = capsPageElements.xpath('//script[contains(text(),"var ptx")]')[0].text_content() ptxjpgstarts = bigScript.find('ptx["jpg"] = {};') ptxjpgends = bigScript.find('togglestatus', ptxjpgstarts) ptxjpg = bigScript[ptxjpgstarts:ptxjpgends] vidcaps = [] imageCount = ptxjpg.count('ptx["jpg"][') for i in range(1, imageCount + 1): alpha = ptxjpg.find('{src: "', omega) + 7 omega = ptxjpg.find('"', alpha) posterUrl = ptxjpg[alpha:omega] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteID) + posterUrl vidcaps.append(posterUrl) for x in range(10): art.append(vidcaps[random.randint(1, imageCount)]) except: pass Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors, art): metadata_id = str(metadata.id).split('|') scene_url = PAutils.Decode(metadata_id[0]) req = PAutils.HTTPRequest(scene_url) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//meta[@name="twitter:image:alt"]/@content')[0] # Summary metadata.summary = detailsPageElements.xpath('//div[@class="content-desc more-desc"]')[0].text_content() # Studio metadata.studio = 'Swallow Bay' # Release Date str_date = detailsPageElements.xpath('//div//div[@class="content-date"]')[0].text_content().strip().replace('Date: ', '') date = re.sub(r'(\d)(st|nd|rd|th)', r'\1', str_date) date_object = datetime.strptime(date, "%d %b %Y") metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() section = detailsPageElements.xpath('//div[@class="content-models"]/a') for actor_section in section: actor_name = actor_section.get('title') actor_photo_xpath = './/div[@class="content-models-photos"]/a[@title="' + actor_name + '"]/span/img' actor_photo_URL = detailsPageElements.xpath(actor_photo_xpath)[0].get('src') movieActors.addActor(actor_name, actor_photo_URL) # Genres movieGenres.clearGenres() for genre_link in detailsPageElements.xpath('//div[@class="box"]/a'): genre_name = genre_link.text_content().strip() movieGenres.addGenre(genre_name) # Posters/Background poster = detailsPageElements.xpath('//meta[@property="og:image"]/@content')[0] art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteID, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h1')[0].text_content( ).replace(',', ' and') + 'from ' + PAsearchSites.getSearchSiteName( siteID).replace(' ', '') + '.com' # Summary try: metadata.summary = detailsPageElements.xpath( '//meta[@name="description"]/@content')[0] except: pass # Studio metadata.studio = 'Teen Core Club' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteID) metadata.tagline = tagline metadata.collections.add(tagline) # Actors movieActors.clearActors() actors = detailsPageElements.xpath('//h1')[0].text_content().strip().split( ',') for actor in actors: actorName = actor.strip() actorPhotoURL = '%s/media/models/%s.jpg' % ( PAsearchSites.getSearchBaseURL(siteID), actorName.lower()) movieActors.addActor(actorName, actorPhotoURL) # Date try: date = detailsPageElements.xpath('//li')[1].text_content().strip() date_object = datetime.strptime(date, '%Y') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year except: pass # Genres movieGenres.clearGenres() genres = detailsPageElements.xpath('//meta[@name="keywords"]/@content')[0] for genreLink in genres.split(','): genreName = genreLink.strip() movieGenres.addGenre(genreName) # Posters art = [] xpaths = [ '//div[contains(@class,"video-detail")]//img/@src', ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): img = 'https:' + img if 'www' in img: art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Studio metadata.studio = 'Woodman Casting X' # Title metadata.title = detailsPageElements.xpath( '//h1')[0].text_content().strip() # Summary description = detailsPageElements.xpath('//p[@class="description"]') if description: metadata.summary = description[0].text_content().replace('\n', '').strip() # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//div[@class="tags"]//a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Release Date date = detailsPageElements.xpath( '//div[@class="info_container"]/p[1]')[0].text_content().replace( 'Published :', '').strip() date_object = datetime.strptime(date, '%Y-%m-%d') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() actors = detailsPageElements.xpath( '//div[contains(@class, "block_girls_videos")]/a[@class="girl_item"]') if actors: for actorLink in actors: actorName = actorLink.xpath( './/span[@class="name"]')[0].text_content().strip() actorPhotoURL = actorLink.xpath('.//img/@src')[0] movieActors.addActor(actorName, actorPhotoURL) else: actorName = detailsPageElements.xpath( '//div[@id="breadcrumb"]/span[@class="crumb"]')[0].text_content( ).split('-')[0].strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] for posterLink in detailsPageElements.xpath( '//video[@class="player_video"]/@poster'): art.append(posterLink) if not art: for script in detailsPageElements.xpath('//script'): try: match = re.search('(?<=image: ")(.*)(?=")', script.text_content()) if match: art.append(match.group(0).strip()) except: pass Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneName = PAutils.Decode(metadata_id[0]) sceneURL = PAsearchSites.getSearchSearchURL(siteNum) + sceneName detailsPageElements = getDatafromAPI(sceneURL) video = detailsPageElements['video'] pictureset = detailsPageElements['pictureset'] # Title metadata.title = video['title'] # Summary metadata.summary = video['description'] # Director director = metadata.directors.new() director.name = video['directorNames'] # Studio metadata.studio = video['primarySite'].title() # Tagline and Collection(s) metadata.collections.clear() metadata.collections.add(metadata.studio) # Release Date date_object = parse(video['releaseDate']) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for tag in ['categories', 'tags']: for genreLink in video[tag]: if isinstance(genreLink, dict): genreName = genreLink['name'] else: genreName = genreLink movieGenres.addGenre(genreName) # Actors movieActors.clearActors() actors = video['modelsSlugged'] for actorLink in actors: actorPageURL = PAsearchSites.getSearchSearchURL( siteNum) + '/' + actorLink['slugged'] actorData = getDatafromAPI(actorPageURL)['model'] actorName = actorData['name'] actorPhotoURL = '' if actorData['images']['profile']: actorPhotoURL = actorData['images']['profile'][0]['highdpi']['3x'] movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] for name in ['movie', 'poster']: if name in video['images'] and video['images'][name]: image = video['images'][name][-1] if 'highdpi' in image: art.append(image['highdpi']['3x']) else: art.append(image['src']) break for image in pictureset: img = image['main'][0]['src'] art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height and idx > 1: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//div[@class="title"]//h1')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//div[@class="description"]//p')[0].text_content() # Studio metadata.studio = 'Wankz' # Release Date date = detailsPageElements.xpath( '//div[@class="views"]//span')[0].text_content().replace('Added', '').strip() date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath( '//div[contains(@class, "actors")]//a[@class="model"]'): actorName = actorLink.xpath('.//span')[0].text_content().strip() actorPhotoURL = actorLink.xpath('.//img/@src')[0] movieActors.addActor(actorName, actorPhotoURL) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath( '//a[@class="cat"] | //p[@style]/a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Posters/Background art = [] xpaths = ['//a[@class="noplayer"]/img/@src'] for xpath in xpaths: for poster in detailsPageElements.xpath(xpath): art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h1')[0].text_content().replace('VR P**n video', '').strip() # Summary description = detailsPageElements.xpath('//div[@class="g-cols onlydesktop"]') if description: metadata.summary = description[0].text_content().strip() # Studio metadata.studio = PAsearchSites.getSearchSiteName(siteNum) # Tagline and Collection metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline metadata.collections.add(tagline) # Release Date script_text = detailsPageElements.xpath('//script[@type="application/ld+json"]')[1].text_content() alpha = script_text.find('datePublished') omega = script_text.find('"', alpha + 16) date = script_text[alpha + 16:omega] if date: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//a[@class="g-btn type_default"]//span'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath('//div[@class="w-portfolio-item-image modelBox"]//img'): actorName = actorLink.get('alt') actorPhotoURL = actorLink.get('src') movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = [ '//dl8-video/@poster', '//figure[contains(@itemprop, "associatedMedia")]/a/@href' ] for xpath in xpaths: for poster in detailsPageElements.xpath(xpath): art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteID, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteID) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//*[@class="trailer-block_title"]')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//div[@class="info-block"]//p[@class="text"]')[0].text_content( ).strip() # Studio metadata.studio = 'Cherry Pimps' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteID).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath( '//div[@class="info-block_data"]//p[@class="text"]')[0].text_content( ).split('|')[0].replace('Added', '').strip() if date: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath( '//div[@class="info-block"]//a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() actors = detailsPageElements.xpath('//div[@class="info-block_data"]//a') if actors: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = actorLink.text_content().strip() actorPhotoURL = '' actorPageURL = actorLink.get('href') if not actorPageURL.startswith('http'): actorPageURL = PAsearchSites.getSearchBaseURL( siteID) + '/' + actorPageURL req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) img = actorPage.xpath( '//img[contains(@class, "model_bio_thumb")]/@src') if not img: img = actorPage.xpath( '//img[contains(@class, "model_bio_thumb")]@src0_1x') if img: actorPhotoURL = img[0] if not actorPhotoURL.startswith('http'): actorPhotoURL = 'https:' + actorPhotoURL movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = ['//img[contains(@class, "update_thumb")]/@src'] for xpath in xpaths: for poster in detailsPageElements.xpath(xpath): if poster.startswith('http'): art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = metadata.id.split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL sceneDate = metadata_id[2] req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//h1[@class="title"]')[0].text_content().title().strip() # Summary metadata.summary = detailsPageElements.xpath( '//p[@class="text"]')[0].text_content() # Studio metadata.studio = PAsearchSites.getSearchSiteName(siteNum) # Tagline and Collection(s) metadata.collections.clear() metadata.tagline = metadata.studio metadata.collections.clear() metadata.collections.add(metadata.studio) # Release Date if sceneDate: date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.addGenre('Glamcore') movieGenres.addGenre('Artistic') # Actors movieActors.clearActors() actors = detailsPageElements.xpath('//h2[@class="starring-models"]/a') if actors: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = actorLink.text_content().strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters/Background art = [] xpaths = [ '//div[@id="video-set-details"]//video[@id="video-playback"]/@poster', '(//img[@class="poster"] | //img[@class="cover"])/@src' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//title')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//span[@class="update_description"]')[0].text_content().strip() # Studio metadata.studio = 'Allure Media' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath( '//div[contains(@class, "update_date")]')[0].text_content().strip() if not date: try: date = str( detailsPageElements.xpath( './/div[@class="cell update_date"]/comment()')[0]).strip() date = date[date.find('OFF') + 4:date.find('D', date.find('OFF') + 4)].strip() except: pass if date: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath( '//span[@class="update_tags"]//a'): genreName = genreLink.text_content().strip('\n').lower() movieGenres.addGenre(genreName) movieGenres.addGenre('Amateur') # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath( '//div[@class="backgroundcolor_info"]//span[@class="update_models"]/a' ): actorName = actorLink.text_content().strip() actorPhotoURL = '' actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) img = actorPage.xpath('//div[@class="cell_top cell_thumb"]/img/@src') if img: actorPhotoURL = img[0] if not actorPhotoURL.startswith('http'): actorPhotoURL = PAsearchSites.getSearchBaseURL( siteNum) + actorPhotoURL movieActors.addActor(actorName, actorPhotoURL) # Manually Add Actors actors = [ 'Faith', 'Nikki Rhodes', 'Talia Tyler', 'Hadley', 'Evangeline', 'Zoe Voss', 'Raquel Diamond', 'Shay Golden', 'Emily Grey', 'Allyssa Hall', 'Alexa Grace', 'Remy LaCroix', 'Nadine Sage', 'Chloe Starr', 'Melissa Moore', 'Taylor Renae', 'Veronica Rodriguez', 'Naomi Woods', 'Amanda Aimes', 'Alice Green', 'Kimber Woods', 'Alina Li', 'Holly Michaels', 'Layla London', 'Dakota Brookes', 'Adriana Chechik', 'Belle Noire', 'Lilly Banks', 'Linda Lay', 'Miley May', 'Belle Knox', 'Ava Taylor', 'Stella May', 'Claire Heart', 'Kennedy Leigh', 'Lucy Tyler', 'Cadence Lux', 'Goldie Glock', 'Jayma Reid', 'Samantha Sin', 'Emma Hix', 'Lexi Mansfield', 'Emma Wilson', 'Kenzie Reeves', 'Devon Green', 'Jane Wilde', 'Lena Anderson', 'Lilly Banks', 'Linda Lay', 'Belle Knox', 'Miley May' ] for actorName in actors: if actorName in metadata.title or actorName in metadata.summary: movieActors.addActor(actorName, '') # Posters art = [] try: bigScript = detailsPageElements.xpath( '//script[contains(text(), "df_movie")]')[0].text_content() alpha = bigScript.find('useimage = "') + 12 omega = bigScript.find('";', alpha) background = bigScript[alpha:omega] if 'http' not in background: background = PAsearchSites.getSearchBaseURL(siteNum) + background art.append(background) except: pass # Slideshow of images from the Search page try: bigScript = detailsPageElements.xpath( '//script[contains(text(), "df_movie")]')[0].text_content() alpha = bigScript.find('setid:"') + 7 omega = bigScript.find('",', alpha) setID = bigScript[alpha:omega] req = PAutils.HTTPRequest( PAsearchSites.getSearchSearchURL(siteNum) + urllib.quote(metadata.title)) searchPageElements = HTML.ElementFromString(req.text) posterUrl = searchPageElements.xpath( '//img[@id="set-target-%s"]/@src' % setID)[0] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteNum) + posterUrl art.append(posterUrl) for i in range(0, 7): try: posterUrl = searchPageElements.xpath( '//img[@id="set-target-%s"]/@src%d_1x' % (setID, i))[0] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL( siteNum) + posterUrl art.append(posterUrl) except: pass except: pass # Photos page photoPageURL = None photoPageURL = detailsPageElements.xpath( '//div[@class="cell content_tab"]/a[text()="Photos"]/@href')[0] req = PAutils.HTTPRequest(photoPageURL) photoPageElements = HTML.ElementFromString(req.text) bigScript = photoPageElements.xpath( '//script[contains(text(), "var ptx")]')[0].text_content() try: ptx1600starts = bigScript.find('1600') ptx1600ends = bigScript.find('togglestatus', ptx1600starts) ptx1600 = bigScript[ptx1600starts:ptx1600ends] photos = [] imageCount = ptx1600.count('ptx["1600"][') for i in range(1, imageCount + 1): alpha = ptx1600.find('{src: "', omega) + 7 omega = ptx1600.find('"', alpha) posterUrl = ptx1600[alpha:omega] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteNum) + posterUrl if i == 5: actorPhotoURL = posterUrl photos.append(posterUrl) for x in range(10): art.append(photos[random.randint(1, imageCount)]) except: pass # Vidcaps page try: ptxjpgstarts = bigScript.find('ptx["jpg"] = {};') ptxjpgends = bigScript.find('togglestatus', ptxjpgstarts) ptxjpg = bigScript[ptxjpgstarts:ptxjpgends] vidcaps = [] imageCount = ptxjpg.count('ptx["jpg"][') for i in range(1, imageCount + 1): alpha = ptxjpg.find('{src: "', omega) + 7 omega = ptxjpg.find('"', alpha) posterUrl = ptxjpg[alpha:omega] if 'http' not in posterUrl: posterUrl = PAsearchSites.getSearchBaseURL(siteNum) + posterUrl if i == 5: actorPhotoURL = posterUrl vidcaps.append(posterUrl) for x in range(10): art.append(vidcaps[random.randint(1, imageCount)]) except: pass Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: referer = photoPageURL if photoPageURL else sceneURL image = PAutils.HTTPRequest(posterUrl, headers={'Referer': referer}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneID = metadata_id[0] title = metadata_id[2].strip() apiurl = getAPIURL( PAsearchSites.getSearchBaseURL(siteNum) + '/scene/' + sceneID + '/' + urllib.quote(title)) apiurl = PAsearchSites.getSearchSearchURL(siteNum) + apiurl searchResult = getJSONfromAPI(apiurl + updatequery.format(sceneID))[0] # Title metadata.title = searchResult['title'] # Summary metadata.summary = searchResult['description'] # Studio metadata.studio = PAsearchSites.getSearchSiteName(siteNum) # Tagline and Collection(s) metadata.collections.clear() metadata.collections.add(metadata.studio) # Release Date date = searchResult['sites']['collection'][sceneID]['publishDate'] date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() movieActors.clearActors() if 'tags' in searchResult: genres = searchResult['tags']['collection'] if not isinstance(genres, list): for (key, value) in genres.items(): genre = value['alias'] if genre: if siteNum == 1027: genre = genre.replace('-', ' ') movieActors.addActor(genre, '') else: movieGenres.addGenre(genre) # Actors actors = getJSONfromAPI(apiurl + modelquery + sceneID) if not isinstance(actors, list): for key, value in actors.items(): collect = value['modelId']['collection'] for k, val in collect.items(): actorName = val['stageName'] if actorName: movieActors.addActor(actorName, '') if siteNum == 1024: baseactor = 'Aletta Ocean' elif siteNum == 1025: baseactor = 'Eva Lovia' elif siteNum == 1026: baseactor = 'Romi Rain' elif siteNum == 1030: baseactor = 'Dani Daniels' elif siteNum == 1031: baseactor = 'Chloe Toy' elif siteNum == 1033: baseactor = 'Katya Clover' elif siteNum == 1035: baseactor = 'Lisey Sweet' elif siteNum == 1037: baseactor = 'Gina Gerson' elif siteNum == 1038: baseactor = 'Valentina Nappi' elif siteNum == 1039: baseactor = 'Vina Sky' elif siteNum == 1058: baseactor = 'Vicki Valkyrie' elif siteNum == 1075: baseactor = 'Dillion Harper' elif siteNum == 1191: baseactor = 'Lilu Moon' else: baseactor = '' movieActors.addActor(baseactor, '') # Posters art = [] artobj = json.loads(PAutils.Decode(metadata_id[3])) if artobj: for searchResult in artobj: art.append(searchResult['url']) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height and idx > 1: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title if '/en/' in sceneURL: metadata.title = PAutils.parseTitle( detailsPageElements.xpath('//title')[0].text_content().split('|') [0].split('-')[0].strip(), siteNum) else: metadata.title = detailsPageElements.xpath( '//title')[0].text_content().split('|')[0].split('-')[0].strip() # Summary metadata.summary = detailsPageElements.xpath( '//div[@class="description clearfix"]')[0].text_content().split( ':')[-1].strip().replace('\n', ' ') # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.studio = tagline metadata.collections.add(tagline) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//div[@class="categories"]/a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() if '/en/' in sceneURL: if '&' in metadata.title: actors = metadata.title.split('&') else: actors = detailsPageElements.xpath( '//span[@class="site-name"]')[0].text_content().split(' and ') else: if '&' in metadata.title: actors = metadata.title.split('&') else: actors = detailsPageElements.xpath( '//span[@class="site-name"]')[0].text_content().split(' y ') for actorLink in actors: actorName = actorLink.strip() modelURL = '%s/actrices/%s' % (PAsearchSites.getSearchBaseURL(siteNum), metadata.title[0].lower()) req = PAutils.HTTPRequest(modelURL) modelPageElements = HTML.ElementFromString(req.text) for model in modelPageElements.xpath( '//div[@class="c-boxlist__box--image"]//parent::a'): if model.text_content().strip().lower() == metadata.title.lower(): actorName = metadata.title break if 'africa' in actorName.lower(): actorName = 'Africat' elif metadata.title == 'MAMADA ARGENTINA': actorName = 'Alejandra Argentina' elif actorName == 'Alika': actorName = 'Alyka' modelURL = '%s/actrices/%s' % (PAsearchSites.getSearchBaseURL(siteNum), actorName[0].lower()) req = PAutils.HTTPRequest(modelURL) modelPageElements = HTML.ElementFromString(req.text) actorPhotoURL = '' for model in modelPageElements.xpath( '//div[@class="c-boxlist__box--image"]//parent::a'): if model.text_content().strip().lower() == actorName.lower(): actorPhotoURL = model.xpath('.//img/@src')[0].strip() break movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] img = detailsPageElements.xpath( '//div[@class="top-area-content"]/script')[0].text_content().strip() posterImage = re.search(r'(?<=posterImage:\s").*(?=")', img) if posterImage: img = posterImage.group(0) art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if height > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneTitle = PAutils.Decode(metadata_id[0]) sceneDescription = PAutils.Decode(metadata_id[2]) sceneDate = metadata_id[3] sceneActors = metadata_id[4] scenePoster = PAutils.Decode(metadata_id[5]) art = [] metadata.collections.clear() movieGenres.clearGenres() movieActors.clearActors() # Title metadata.title = sceneTitle # Summary metadata.summary = sceneDescription # Studio metadata.studio = 'PureCFNM' # Tagline and Collection(s) subSite = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = subSite metadata.collections.add(subSite) # Genres if subSite.lower() == 'AmateurCFNM'.lower(): for genreName in ['CFNM']: movieGenres.addGenre(genreName) elif subSite.lower() == 'CFNMGames'.lower(): for genreName in ['CFNM', 'Femdom']: movieGenres.addGenre(genreName) elif subSite.lower() == 'GirlsAbuseGuys'.lower(): for genreName in ['CFNM', 'Femdom', 'Male Humiliation']: movieGenres.addGenre(genreName) elif subSite.lower() == 'HeyLittleDick'.lower(): for genreName in ['CFNM', 'Femdom', 'Small Penis Humiliation']: movieGenres.addGenre(genreName) elif subSite.lower() == 'LadyVoyeurs'.lower(): for genreName in ['CFNM', 'Voyeur']: movieGenres.addGenre(genreName) elif subSite.lower() == 'PureCFNM'.lower(): for genreName in ['CFNM']: movieGenres.addGenre(genreName) # Release Date date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors actors = sceneActors.split(',') if actors: if len(actors) == 2: movieGenres.addGenre('Threesome') elif len(actors) == 3: movieGenres.addGenre('Foursome') elif len(actors) > 3: movieGenres.addGenre('Group') for actorLink in actors: actorName = actorLink.strip() actorPhotoURL = ' ' movieActors.addActor(actorName, actorPhotoURL) # Posters art = [scenePoster] Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h1[@class="customhcolor"]')[0].text_content() # Summary metadata.summary = detailsPageElements.xpath('//div[@class="customhcolor2"]')[0].text_content().strip() # Studio metadata.studio = PAsearchSites.getSearchSiteName(siteNum) # Tagline and Collection(s) metadata.collections.clear() metadata.tagline = metadata.studio metadata.collections.add(metadata.studio) # Release Date date = detailsPageElements.xpath('//div[@class="date"]')[0].text_content().strip() date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() genres = detailsPageElements.xpath('//h4[@class="customhcolor"]')[0].text_content().strip().split(',') for genreLink in genres: genreName = genreLink.strip() movieGenres.addGenre(genreName) # Actors / possible posters movieActors.clearActors() actors = detailsPageElements.xpath('//h3[@class="customhcolor"]') for actorLink in actors: actorName = actorLink.text_content().strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters/Background art = [] Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL( siteNum) + '/fintour/' + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//div[@class="title_bar"]')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//div[@class="gallery_description"]')[0].text_content().strip() # Studio metadata.studio = 'Desperate Amateurs' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline if Prefs['collections_addsitename']: metadata.collections.add(tagline) # Release Date date_object = parse( detailsPageElements.xpath('.//td[@class="date"]') [0].text_content().strip()[6:]) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath( '//a[starts-with(@href, "sets")]'): actorName = actorLink.text_content().strip() actorPageURL = PAsearchSites.getSearchBaseURL( siteNum) + '/fintour/' + actorLink.xpath('./@href')[0].strip() req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) actorPhotoURL = PAsearchSites.getSearchBaseURL( siteNum) + actorPage.xpath('//img[@class="thumbs"]/@src')[0] movieActors.addActor(actorName, actorPhotoURL) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath( '//a[starts-with(@href, "category")]'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Posters art = [] xpaths = [ '//div[contains(@class, "gal")]//img/@src', ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl, headers={'Referer': sceneURL}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors, art): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h1[contains(@class, "video-title")]')[0].text_content() # Summary metadata.summary = detailsPageElements.xpath('//p[@class="video-description"]')[0].text_content().strip() # Studio metadata.studio = 'BadoinkVR' # Tagline and Collection metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline metadata.collections.add(tagline) # Release Date sceneDate = detailsPageElements.xpath('//p[@itemprop="uploadDate"]/@content') if sceneDate: date_object = parse(sceneDate[0]) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//a[@class="video-tag"]'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath('//a[contains(@class, "video-actor-link")]'): actorName = actorLink.text_content().strip() actorPageURL = PAsearchSites.getSearchBaseURL(siteNum) + actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) actorPhotoURL = actorPage.xpath('//img[@class="girl-details-photo"]/@src')[0].split('?')[0] movieActors.addActor(actorName, actorPhotoURL) # Posters xpaths = [ '//div[contains(@class, "gallery-item")]/@data-big-image', '//img[@class="video-image"]/@src' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): img = img.split('?')[0] art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if idx > 1 and width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteID, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteID) + sceneURL sceneDate = metadata_id[2] req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//h1[@itemprop="name"]')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//section[@class="scene-content"]//p[@itemprop="description"]' )[0].text_content().strip() # Studio metadata.studio = 'Finishes The Job' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteID) metadata.tagline = tagline metadata.collections.add(tagline) # Release Date if sceneDate: date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() actors = detailsPageElements.xpath( '//section[@class="scene-content"]//h4//a') for actorLink in actors: actorName = actorLink.text_content() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Genres movieGenres.clearGenres() genres = detailsPageElements.xpath( '//section[@class="scene-content"]//p[1]//a') for genre in genres: movieGenres.addGenre(genre.text_content()) # Poster art = [] xpaths = ['//video/@poster'] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) for posterCur in detailsPageElements.xpath( '//div[contains(@class, "first-set")]//img'): sceneName = posterCur.get('alt') if sceneName.lower() == metadata.title.lower(): art.append(posterCur.get('src')) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//title')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath('//div[@class="desc"]/div[1]/p')[0].text_content().strip() # Studio metadata.studio = 'We Are Hairy' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath('//span[@class="added"]/time')[0].text_content().strip() if date: date_object = datetime.strptime(date, '%b %d, %Y') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//div[@class="tagline"]/p/a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) movieGenres.addGenre('Hairy Girls') movieGenres.addGenre('Hairy Pussy') # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath('//div[@class="meet"]/a/img'): actorName = actorLink.get('alt').replace('WeAreHairy.com', '').strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Director director = metadata.directors.new() try: directors = detailsPageElements.xpath('//div[@class="desc"]/div[2]/p') for dirname in directors: director.name = dirname.text_content().strip() except: pass # Posters art = [] xpaths = [ '//div[@class="moviemain"]/div[1]/a/img/@src' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): if not img.startswith('http'): img = 'https:' + img art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) art = [] # Title metadata.title = detailsPageElements.xpath('//div[@class="fltWrap"]/h1/span')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath('//p[@class="description"]')[0].text_content().replace('Description:', '').strip() # Studio metadata.studio = 'ClubFilly' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline if Prefs['collections_addsitename']: metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath('//div[@class="fltRight"]')[0].text_content().replace('Release Date :', '').strip() if date: date_object = datetime.strptime(date, '%Y-%m-%d') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() movieGenres.addGenre('Lesbian') # Actors movieActors.clearActors() actorText = detailsPageElements.xpath('//p[@class="starring"]')[0].text_content().replace('Starring:', '').strip() actors = actorText.split(',') if len(actors) > 0: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = actorLink.strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = [ '//ul[@id="lstSceneFocus"]/li/img/@src' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) art = [] # Title metadata.title = detailsPageElements.xpath( '//h1[@class="latest-scene-title"]')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//span[contains(@class, "full-description")]')[0].text_content( ).strip() # Studio metadata.studio = 'VRHush' # Tagline and Collection metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline if Prefs['collections_addsitename']: metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath( '//div[contains(@class, "latest-scene-meta")]//div[contains(@class, "text-left")]' )[0].text_content().strip() if date: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() genres = detailsPageElements.xpath('//a[contains(@class, "label")]') for genreLink in genres: genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() for actorLink in detailsPageElements.xpath( '//h5[@class="latest-scene-subtitle"]//a[contains(@href, "/models/")]' ): actorName = actorLink.text_content().strip() actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) actorPhotoURL = 'https:' + actorPage.xpath( '//img[@id="model-thumbnail"]/@src')[0] art.append(actorPhotoURL) movieActors.addActor(actorName, actorPhotoURL) # Posters xpaths = [ '//dl8-video/@poster', '//div[contains(@class, "owl-carousel")]//img/@src' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): if not img.startswith('http'): img = 'https:' + img art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL sceneDate = metadata_id[2] req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h2[@class="nice-title"]')[0].text_content().strip() # Summary description = detailsPageElements.xpath('//div[@class="desc-text"]//p') if description: metadata.summary = description[0].text_content().strip() # Studio metadata.studio = 'Czech Authentic Videos' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = tagline if Prefs['collections_addsitename']: metadata.collections.add(tagline) # Release Date if sceneDate: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//ul[@class="tags"]/li'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() # Posters art = [] xpaths = [ '//meta[@property="og:image"]/@content', '//img[@class="thumb"]/@src' ] for xpath in xpaths: for poster in detailsPageElements.xpath(xpath): art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors, art): metadata_id = str(metadata.id).split('|') sceneTitle = PAutils.Decode(metadata_id[0]) sceneDescription = PAutils.Decode(metadata_id[2]) sceneDate = metadata_id[3] scenePoster = PAutils.Decode(metadata_id[4]) metadata.collections.clear() movieGenres.clearGenres() movieActors.clearActors() # Title metadata.title = sceneTitle # Summary metadata.summary = sceneDescription # Studio metadata.studio = 'Thick Cash' # Tagline and Collection(s) subSite = PAsearchSites.getSearchSiteName(siteNum) metadata.tagline = subSite metadata.collections.add(subSite) # Genres if subSite.lower() == 'Family Lust'.lower(): for genreName in ['Family Roleplay']: movieGenres.addGenre(genreName) elif subSite.lower() == 'Over 40 Handjobs'.lower(): for genreName in ['MILF', 'Handjob']: movieGenres.addGenre(genreName) elif subSite.lower() == 'Ebony Tugs'.lower(): for genreName in ['Ebony', 'Handjob']: movieGenres.addGenre(genreName) elif subSite.lower() == 'Teen Tugs'.lower(): for genreName in ['Teen', 'Handjob']: movieGenres.addGenre(genreName) # Release Date date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Posters art.append(scenePoster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//span[@class="update_title"] | //p[@class="raiting-section__title"]' )[0].text_content().strip() # Summary try: metadata.summary = detailsPageElements.xpath( '//span[@class="latest_update_description"] | //p[contains(@class, "text")]' )[0].text_content().replace('Includes:', '').replace('Synopsis:', '').strip() except: pass # Studio metadata.studio = PAsearchSites.getSearchSiteName(siteNum) # Tagline and Collection(s) metadata.collections.clear() tagline = metadata.studio metadata.tagline = tagline metadata.collections.add(tagline) # Release Date try: date = detailsPageElements.xpath( '//span[@class="update_date"] | //span[contains(@class, "availdate")]' )[0].text_content().replace('Available to Members Now', '').strip() except: date = detailsPageElements.xpath('//p[@class="dvd-scenes__data"]')[ 0].text_content().split('|')[1].replace('Added:', '').strip() if date: date_object = parse(date) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() actors = detailsPageElements.xpath( '//div[@class="update_block"]//span[@class="tour_update_models"]//a | //p[@class="dvd-scenes__data"][1]//a' ) for actorLink in actors: actorName = actorLink.text_content().strip() if siteNum == 1264 and metadata.title.endswith(': ' + actorName): metadata.title = metadata.title[:-len(': ' + actorName)] actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPageElements = HTML.ElementFromString(req.text) actorPhotoURL = '' actorPhotoElement = actorPageElements.xpath( '//img[contains(@class, "model_bio_thumb")]/@src0_1x') if actorPhotoElement: actorPhotoURL = actorPhotoElement[0] if not actorPhotoURL.startswith('http'): actorPhotoURL = PAsearchSites.getSearchBaseURL( siteNum) + actorPhotoURL movieActors.addActor(actorName, actorPhotoURL) # Genres movieGenres.clearGenres() genres = detailsPageElements.xpath( '//span[contains(@class, "update_tags")]//a | //p[@class="dvd-scenes__data"][2]//a' ) for genreLink in genres: genreName = genreLink.text_content() movieGenres.addGenre(genreName) # Posters/Background art = [] xpaths = [ '//img[contains(@class, "update_thumb")]/@src0_4x', '//img[contains(@class, "update_thumb")]/@src0_1x', ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): if not img.startswith('http'): img = PAsearchSites.getSearchBaseURL(siteNum) + '/' + img art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 and height >= width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteID, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = 'https://' + PAutils.Decode(metadata_id[0]) req = PAutils.HTTPRequest(sceneURL, cookies={'nats': 'MC4wLjMuNTguMC4wLjAuMC4w'}) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//h4')[0].text_content()[36:].strip() # Summary metadata.summary = detailsPageElements.xpath( '//p[contains(@class,"card-text")]')[0].text_content().strip() # Studio metadata.studio = 'PornFidelity' # Tagline and Collection(s) metadata.collections.clear() if 'Teenfidelity' in metadata.title: tagline = 'TeenFidelity' elif 'Kelly Madison' in metadata.title: tagline = 'Kelly Madison' else: tagline = 'PornFidelity' metadata.tagline = tagline metadata.collections.add(tagline) # Release Date for metadataPart in detailsPageElements.xpath( '//div[contains(@class,"episode-summary")]//h4'): if 'Published' in metadataPart.text_content(): releaseDate = metadataPart.text_content()[39:49] date_object = datetime.strptime(releaseDate, '%Y-%m-%d') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() movieGenres.addGenre('Hardcore') movieGenres.addGenre('Heterosexual') # Actors movieActors.clearActors() actors = detailsPageElements.xpath( '//div[contains(@class, "episode-summary")]//a[contains(@href, "/models/")]' ) if actors: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = actorLink.text_content() actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest( actorPageURL, cookies={'nats': 'MC4wLjMuNTguMC4wLjAuMC4w'}) actorPage = HTML.ElementFromString(req.text) actorPhotoURL = actorPage.xpath( '//img[@class="img-fluid"]/@src')[0] movieActors.addActor(actorName, actorPhotoURL) # Posters/Background art = [ 'https://tour-cdn.kellymadisonmedia.com/content/episode/poster_image/%s/poster.jpg' % sceneURL.rsplit('/')[-1] ] Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if sceneURL.startswith('http'): PAsearchSites.getSearchBaseURL(siteNum) + sceneURL if len(metadata_id) > 2: sceneDate = metadata_id[2] req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( './/a[@class="dark"]')[0].text_content().strip() # Studio metadata.studio = 'Melone Challenge' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Release Date if sceneDate: date_object = parse(sceneDate) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Posters/Background art = [] xpaths = ['.//figure/img/@src'] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) javID = detailsPageElements.xpath( '//dt[text()="DVD ID:"]/following-sibling::dd[1]')[0].text_content( ).strip() if javID.startswith('--'): javID = detailsPageElements.xpath( '//dt[text()="Content ID:"]/following-sibling::dd[1]' )[0].text_content().strip() if ' ' in javID: javID = javID.upper.replace(' ', '-') # Title JavTitle = detailsPageElements.xpath( "//cite[@itemprop='name']")[0].text_content().strip() # Undoing the Self Censoring R18.com does to their tags and titles if '**' in JavTitle: JavTitle = JavTitle.replace('R**e', 'Rape') JavTitle = JavTitle.replace('S********l', 'Schoolgirl') JavTitle = JavTitle.replace('S***e', 'Slave') JavTitle = JavTitle.replace('M****t', 'Molest') JavTitle = JavTitle.replace('F***e', 'Force') JavTitle = JavTitle.replace('G*******g', 'Gang Bang') JavTitle = JavTitle.replace('G******g', 'G******g') JavTitle = JavTitle.replace('K*d', 'Descendant') JavTitle = JavTitle.replace('C***d', 'Descendant') JavTitle = JavTitle.replace('T*****e', 'Torture') JavTitle = JavTitle.replace('T******e', 'Tentacle') JavTitle = JavTitle.replace('D**g', 'Drug') JavTitle = JavTitle.replace('P****h', 'Punish') JavTitle = JavTitle.replace('S*****t', 'Student') JavTitle = JavTitle.replace('V*****e', 'Violate') JavTitle = JavTitle.replace('V*****t', 'Violent') JavTitle = JavTitle.replace('B***d', 'Blood') JavTitle = JavTitle.replace('M************n', 'Mother and Son') metadata.title = javID + ' ' + JavTitle # Summary try: description = detailsPageElements.xpath( '//div[@class="cmn-box-description01"]')[0].text_content() metadata.summary = description.replace('Product Description', '', 1).strip() except: pass # Studio metadata.studio = detailsPageElements.xpath( '//dd[@itemprop="productionCompany"]')[0].text_content().strip() # Director director = metadata.directors.new() directorName = detailsPageElements.xpath( '//dd[@itemprop="director"]')[0].text_content().strip() if directorName != '----': director.name = directorName # Release Date date = detailsPageElements.xpath( '//dd[@itemprop="dateCreated"]')[0].text_content().strip().replace( '.', '').replace(',', '').replace('Sept', 'Sep').replace( 'June', 'Jun').replace('July', 'Jul') date_object = datetime.strptime(date, '%b %d %Y') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() for actor in detailsPageElements.xpath( '//div[@itemprop="actors"]//span[@itemprop="name"]'): fullActorName = actor.text_content().strip() if fullActorName != '----': splitActorName = fullActorName.split('(') mainName = splitActorName[0].strip() actorPhotoURL = detailsPageElements.xpath( '//div[@id="%s"]//img[contains(@alt, "%s")]/@src' % (mainName.replace(' ', ''), mainName))[0] if actorPhotoURL.rsplit('/', 1)[1] == 'nowprinting.gif': actorPhotoURL = '' if len(splitActorName) > 1 and mainName == splitActorName[1][:-1]: actorName = mainName else: actorName = fullActorName movieActors.addActor(actorName, actorPhotoURL) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//a[@itemprop="genre"]'): genreName = (genreLink.text_content().lower().strip()).lower() if '**' in genreName: genreName = genreName.replace('r**e', 'rape') genreName = genreName.replace('s********l', 'schoolgirl') genreName = genreName.replace('s***e', 'slave') genreName = genreName.replace('m****ter', 'molester') genreName = genreName.replace('g*******g', 'gang bang') genreName = genreName.replace('g******g', 'g******g') genreName = genreName.replace('k*d', 'descendant') genreName = genreName.replace('c***d', 'descendant') genreName = genreName.replace('f***e', 'force') genreName = genreName.replace('t*****e', 'torture') genreName = genreName.replace('t******e', 'tentacle') genreName = genreName.replace('d**g', 'drug') genreName = genreName.replace('p****h', 'punish') genreName = genreName.replace('s*****t', 'student') genreName = genreName.replace('v*****e', 'violate') genreName = genreName.replace('v*****t', 'violent') genreName = genreName.replace('b***d', 'blood') movieGenres.addGenre(genreName) metadata.collections.add('Japan Adult Video') # Posters art = [] xpaths = [ '//img[@itemprop="image"]/@src', '//img[contains(@alt, "cover")]/@src', '//section[@id="product-gallery"]//img/@data-src' ] for xpath in xpaths: for poster in detailsPageElements.xpath(xpath): art.append(poster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest( posterUrl, headers={'Referer': 'http://www.google.com'}) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and idx > 1: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath('//h1')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath('//div[@id="content-more-less"]/p')[0].text_content().strip() # Studio metadata.studio = 'CumLouder' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline if Prefs['collections_addsitename']: metadata.collections.add(tagline) # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//ul[@class="tags"]/li/a'): genreName = genreLink.text_content().strip() movieGenres.addGenre(genreName) # Release Date - no actual date aviable, guessing (better than nothing) date = detailsPageElements.xpath('//div[@class="added"]')[0].text_content().strip() timeframe = date.split()[2] timenumber = int(date.split()[1]) today = datetime.now() if timeframe: if timeframe == 'minutes': date_object = today elif timeframe == 'hour' or timeframe == 'hours': date_object = today - relativedelta(hours=timenumber) elif timeframe == 'day' or timeframe == 'days': date_object = today - relativedelta(days=timenumber) elif timeframe == 'week' or timeframe == 'weeks': date_object = today - relativedelta(weeks=timenumber) elif timeframe == 'month' or timeframe == 'months': date_object = today - relativedelta(months=timenumber) elif timeframe == 'year' or timeframe == 'years': date_object = today - relativedelta(years=timenumber) metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Actors movieActors.clearActors() actors = detailsPageElements.xpath('//a[@class="pornstar-link"]') if actors: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = actorLink.text_content().strip() actorPhotoURL = '' movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = [ '//div[@class="box-video box-video-html5"]/video/@lazy' ] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//h1')[0].text_content().strip() # Summary metadata.summary = detailsPageElements.xpath( '//div[@class="more text-justify"]')[0].text_content().strip() # Studio metadata.studio = 'FuckingAwesome' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath( '//div[@class="videodate"]/strong')[0].text_content().strip() if date: date_object = datetime.strptime(date, '%B %d, %Y') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() for genreLink in detailsPageElements.xpath('//div[@class="tags"]/ul/li/a'): genreName = genreLink.text_content().strip().lower() movieGenres.addGenre(genreName) # Actors movieActors.clearActors() actors = detailsPageElements.xpath( '//div[@class="pornstarnames"]/ul/li/a[contains(@href, "pornstars")]') if actors: if len(actors) == 3: movieGenres.addGenre('Threesome') if len(actors) == 4: movieGenres.addGenre('Foursome') if len(actors) > 4: movieGenres.addGenre('Orgy') for actorLink in actors: actorName = str(actorLink.text_content().strip()) actorPageURL = PAsearchSites.getSearchBaseURL( siteNum) + actorLink.get("href") req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) actorPhotoURL = actorPage.xpath( '//div[@class="pornstar-pic "]/img/@src')[0] if 'http' not in actorPhotoURL: actorPhotoURL = PAsearchSites.getSearchBaseURL( siteNum) + actorPhotoURL movieActors.addActor(actorName, actorPhotoURL) # Posters art = [] xpaths = ['//span[@class="et_pb_image_wrap "]/img/@content'] for xpath in xpaths: for img in detailsPageElements.xpath(xpath): art.append(img) try: photoPageUrl = PAsearchSites.getSearchBaseURL( siteNum) + detailsPageElements.xpath( '//li[@class="photos"]/a/@href')[0] req = PAutils.HTTPRequest(photoPageUrl) photoPage = HTML.ElementFromString(req.text) unlockedPhotos = photoPage.xpath('//div[@class="my-gallery"]/a/@href') for unlockedPhoto in unlockedPhotos: if 'http' not in unlockedPhoto: art.append( PAsearchSites.getSearchBaseURL(siteNum) + unlockedPhoto) else: art.append(unlockedPhoto) except: pass Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1 or height > width: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100 and width > height: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata
def update(metadata, lang, siteNum, movieGenres, movieActors, art): metadata_id = str(metadata.id).split('|') sceneURL = PAutils.Decode(metadata_id[0]) if not sceneURL.startswith('http'): sceneURL = PAsearchSites.getSearchBaseURL(siteNum) + sceneURL scenePoster = PAutils.Decode(metadata_id[2]) req = PAutils.HTTPRequest(sceneURL) detailsPageElements = HTML.ElementFromString(req.text) # Title metadata.title = detailsPageElements.xpath( '//div[@class="item-info"]/h4/a')[0].text_content().strip() # Summary description = detailsPageElements.xpath('//p[@class="description"]') if description: metadata.summary = description[0].text_content().strip() # Studio metadata.studio = 'BAMVisions' # Tagline and Collection(s) metadata.collections.clear() tagline = PAsearchSites.getSearchSiteName(siteNum).strip() metadata.tagline = tagline metadata.collections.add(tagline) # Release Date date = detailsPageElements.xpath('//ul[@class="item-meta"]/li[1]')[ 0].text_content().split('Release Date:')[1].strip() if date: date_object = datetime.strptime(date, '%B %d, %Y') metadata.originally_available_at = date_object metadata.year = metadata.originally_available_at.year # Genres movieGenres.clearGenres() movieGenres.addGenre('Anal') movieGenres.addGenre('Hardcore') # Actors movieActors.clearActors() actors = detailsPageElements.xpath('//div[@class="item-info"]/h5/a') for actorLink in actors: actorName = actorLink.text_content().strip() actorPhotoURL = '' actorPageURL = actorLink.get('href') req = PAutils.HTTPRequest(actorPageURL) actorPage = HTML.ElementFromString(req.text) img = actorPage.xpath('//div[@class="profile-pic"]/img/@src0_3x') if img: actorPhotoURL = img[0] if 'http' not in actorPhotoURL: actorPhotoURL = PAsearchSites.getSearchBaseURL( siteNum) + actorPhotoURL movieActors.addActor(actorName, actorPhotoURL) # Posters art.append(PAsearchSites.getSearchBaseURL(siteNum) + scenePoster) Log('Artwork found: %d' % len(art)) for idx, posterUrl in enumerate(art, 1): if not PAsearchSites.posterAlreadyExists(posterUrl, metadata): # Download image file for analysis try: image = PAutils.HTTPRequest(posterUrl) im = StringIO(image.content) resized_image = Image.open(im) width, height = resized_image.size # Add the image proxy items to the collection if width > 1: # Item is a poster metadata.posters[posterUrl] = Proxy.Media(image.content, sort_order=idx) if width > 100: # Item is an art item metadata.art[posterUrl] = Proxy.Media(image.content, sort_order=idx) except: pass return metadata