Skip to content

Commit

Permalink
Consolidated PornFidelity sites to one file, updated search to return…
Browse files Browse the repository at this point in the history
… in standard format
  • Loading branch information
PAhelper committed Jan 22, 2019
1 parent a644f66 commit 06b0185
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 230 deletions.
6 changes: 3 additions & 3 deletions Contents/Code/PAsearchSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@
searchSites[181] = ["We Live Together","We Live Together", "https://www.realitykings.com/", "https://www.realitykings.com/tour/search/videos/"]
searchSites[182] = ["Wives in Pantyhose","Wives in Pantyhose", "https://www.realitykings.com/", "https://www.realitykings.com/tour/search/videos/"]
searchSites[183] = ["21Naturals","21Naturals","https://www.21naturals.com","http://www.21naturals.com/en/search/"]
searchSites[184] = ["PornFidelity","PornFidelity","https://www.pornfidelity.com","https://www.pornfidelity.com/?search="]
searchSites[185] = ["TeenFidelity","TeenFidelity","https://www.pornfidelity.com","https://www.pornfidelity.com/?search="]
searchSites[186] = ["Kelly Madison","Kelly Madison","https://www.pornfidelity.com","https://www.pornfidelity.com/?search="]
searchSites[184] = ["PornFidelity","PornFidelity","https://www.pornfidelity.com","https://www.pornfidelity.com/episodes/search/?site=2&page=1&search="]
searchSites[185] = ["TeenFidelity","TeenFidelity","https://www.pornfidelity.com","https://www.pornfidelity.com/episodes/search/?site=3&page=1&search="]
searchSites[186] = ["Kelly Madison","Kelly Madison","https://www.pornfidelity.com","https://www.pornfidelity.com/episodes/search/?site=1&page=1&search="]
searchSites[187] = ["TeamSkeet", "TeamSkeet", "https://www.teamskeet.com","https://www.teamskeet.com/t1/search/results/?query="]
searchSites[188] = ["Exxxtra small","Exxxtra small", "https://www.teamskeet.com","https://www.teamskeet.com/t1/search/results/?query="]
searchSites[189] = ["Teen Pies","Teen Pies", "https://www.teamskeet.com","https://www.teamskeet.com/t1/search/results/?query="]
Expand Down
26 changes: 5 additions & 21 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ def search(self, results, media, lang):
###############
if siteNum == 184:
if searchAll or searchSiteID == 184:
results = PAsearchSites.sitePornFidelity.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)
results = PAsearchSites.networkPornFidelity.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)

###############
## TeenFidelity
###############
if siteNum == 185:
if searchAll or searchSiteID == 185:
results = PAsearchSites.siteTeenFidelity.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)
results = PAsearchSites.networkPornFidelity.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)

###############
## Kelly Madison
###############
if siteNum == 186:
if searchAll or searchSiteID == 186:
results = PAsearchSites.siteKellyMadison.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)
results = PAsearchSites.networkPornFidelity.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchAll, searchSiteID)

###############
## Team Skeet
Expand Down Expand Up @@ -451,24 +451,8 @@ def update(self, metadata, media, lang):
## PornFidelity ##
## ##
##############################################################
if siteID == 184:
metadata = PAsearchSites.sitePornFidelity.update(metadata,siteID,movieGenres,movieActors)

##############################################################
## ##
## TeenFidelity ##
## ##
##############################################################
if siteID == 185:
metadata = PAsearchSites.siteTeenFidelity.update(metadata,siteID,movieGenres,movieActors)

##############################################################
## ##
## Kelly Madison ##
## ##
##############################################################
if siteID == 186:
metadata = PAsearchSites.siteKellyMadison.update(metadata,siteID,movieGenres,movieActors)
if siteID >= 184 and siteID <= 186:
metadata = PAsearchSites.networkPornFidelity.update(metadata,siteID,movieGenres,movieActors)

##############################################################
## ##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
import PAsearchSites
import PAgenres
def search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate,searchAll,searchSiteID):
if searchSiteID != 9999:
siteNum = searchSiteID
searchPageContent = HTTP.Request("https://www.pornfidelity.com") #The search page seems to redirect to PornFidelity.com if you didn't just come from there, so I open this first to trick it...
searchPageContent = HTTP.Request("https://www.pornfidelity.com/episodes/search/?site=1&page=1&search=" + encodedTitle)
searchPageContent = HTTP.Request(PAsearchSites.getSearchSearchURL(siteNum) + encodedTitle)
searchPageContent = str(searchPageContent).split('":"')
searchPageResult = searchPageContent[len(searchPageContent)-1][:-2]
searchPageResult = searchPageResult.replace('\\n',"").replace('\\',"")
#Log(searchPageResult)
searchResults = HTML.ElementFromString(searchPageResult)
for searchResult in searchResults.xpath('//div[contains(@class,"d-flex")]'):
titleNoFormatting = searchResult.xpath('.//a[@class="text-km"]')[0].text_content().strip()
titleNoFormatting = searchResult.xpath('.//a[@class="text-km"] | .//a[@class="text-pf"] | .//a[@class="text-tf"]')[0].text_content().strip()
Log(titleNoFormatting)
curID = searchResult.xpath('.//a[@class="text-km"]')[0].get('href')
curID = curID.replace('/','_')
curID = searchResult.xpath('.//a[@class="text-km"] | .//a[@class="text-pf"] | .//a[@class="text-tf"]')[0].get('href')
curID = curID.replace('/','_').replace('?','!')
curID = curID[8:-19]
Log("ID: " + curID)
releasedDate = searchResult.xpath('.//div[contains(@class,"text-left")]')[0].text_content().strip()[10:]
if ", 20" not in releasedDate:
releasedDate = releasedDate + ", " + str(datetime.now().year)
releaseDate = searchResult.xpath('.//div[contains(@class,"text-left")]')[0].text_content().strip()[10:]
if ", 20" not in releaseDate:
releaseDate = releaseDate + ", " + str(datetime.now().year)
releaseDate = parse(releaseDate).strftime('%Y-%m-%d')
Log(str(curID))
lowerResultTitle = str(titleNoFormatting).lower()
if searchByDateActor != True:
score = 102 - Util.LevenshteinDistance(searchTitle.lower(), titleNoFormatting.lower())
else:
searchDateCompare = datetime.strptime(searchDate, '%Y-%m-%d').strftime('%b %m, $Y')
score = 102 - Util.LevenshteinDistance(searchDateCompare.lower(), releasedDate.lower())
titleNoFormatting = titleNoFormatting + " [" + PAsearchSites.getSearchSiteName(siteNum) + ", " + releasedDate + "]"
score = 102 - Util.LevenshteinDistance(searchDateCompare.lower(), releaseDate.lower())
titleNoFormatting = titleNoFormatting + " [" + PAsearchSites.getSearchSiteName(siteNum) + "] " + releaseDate
results.Append(MetadataSearchResult(id = curID + "|" + str(siteNum), name = titleNoFormatting, score = score, lang = lang))

return results
Expand All @@ -40,16 +43,21 @@ def update(metadata,siteID,movieGenres,movieActors):

# Summary
metadata.studio = "PornFidelity"
metadata.summary = detailsPageElements.xpath('//p[contains(@class,"card-text")]')[0].text_content()
metadata.summary = detailsPageElements.xpath('//p[contains(@class,"card-text")]')[0].text_content().strip()
metadata.title = detailsPageElements.xpath('//h4')[0].text_content()[36:].strip()
tagline = "Kelly Madison"
if "Teenfidelity" in metadata.title:
tagline = "TeenFidelity"
elif "Kelly Madison" in metadata.title:
tagline = "Kelly Madison"
else:
tagline = "PornFidelity"
Log(metadata.title)
metadataParts = detailsPageElements.xpath('//div[contains(@class,"episode-summary")]//h4')
for metadataPart in metadataParts:
if "Published" in metadataPart.text_content():
releasedDate = metadataPart.text_content()[39:49]
Log(releasedDate)
date_object = datetime.strptime(releasedDate, '%Y-%m-%d')
releaseDate = metadataPart.text_content()[39:49]
Log(releaseDate)
date_object = datetime.strptime(releaseDate, '%Y-%m-%d')
metadata.originally_available_at = date_object
metadata.year = metadata.originally_available_at.year

Expand Down Expand Up @@ -89,7 +97,6 @@ def update(metadata,siteID,movieGenres,movieActors):
metadata.posters[background] = Proxy.Preview(HTTP.Request(background).content, sort_order = 1)
except:
pass




Expand Down
95 changes: 0 additions & 95 deletions Contents/Code/sitePornFidelity.py

This file was deleted.

96 changes: 0 additions & 96 deletions Contents/Code/siteTeenFidelity.py

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ No real error checking is implemented. It was quickly tested on 10+ titles per s
- GloryholeSecrets only searches by their video title, and their title is very structured and limited. Best to just search for girl's first name only e.g. "GloryholeSecrets - Rachele"

## Change Log/Updates
- 2019-01-22 8:15AM CST - Consolidated PornFidelity sites to one file, updated search to return in standard format
- 2019-01-21 9:00AM CST - Cleaned up the search section of init, a few other bugfixes
- 2019-01-20 5:15PM CST - Merged Dev's code for JulesJordan, Dogfart Network, DDF Network, and the Perfect Gonzo network. Added 21Sextreme network to the existing GammaEnt file.
- 2019-01-15 7:45AM CST - Added 4 new NaughtyAmerica sites: LA Sluts, Slut Stepsister, Teens Love Cream, and Latina Stepmom
Expand Down

0 comments on commit 06b0185

Please sign in to comment.