-
Notifications
You must be signed in to change notification settings - Fork 140
Troubleshooting the Code
2019-11-22 06:34:56,832 (19fc) : INFO (logkit:16) - ^^^^^^^ siteID: 537
2019-11-22 06:34:56,832 (19fc) : INFO (logkit:16) - ^^^^^^^ Shortening Title
2019-11-22 06:34:56,832 (19fc) : INFO (logkit:16) - bountyhunter porn vs bountyhunter porn
2019-11-22 06:34:56,834 (19fc) : INFO (logkit:16) - 1
2019-11-22 06:34:56,834 (19fc) : INFO (logkit:16) - 7
2019-11-22 06:34:56,835 (19fc) : INFO (logkit:16) - searchTitle (before date processing): 2015 12 18 31475 Bounty Hunters
2019-11-22 06:34:56,835 (19fc) : INFO (logkit:16) - Search Title: 31475 Bounty Hunters
2019-11-22 06:34:56,835 (19fc) : INFO (logkit:16) - Search Date: 2015-12-18
2019-11-22 06:34:56,835 (19fc) : INFO (logkit:16) - 31475%20Bounty%20Hunters
2019-11-22 06:34:56,859 (19fc) : DEBUG (networking:161) - Fetching 'https://nubiles-porn.com/video/website/23/date/2015-12-18/2015-12-18' from the HTTP cache
2019-11-22 06:34:56,881 (19fc) : CRITICAL (core:574) - Exception in the search function of agent named 'PhoenixAdult', called with keyword arguments {'year': None, 'id': '26422', 'name': 'Bountyhunter Porn 2015 12 18 31475 Bounty Hunters'} (most recent call last):
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-36236cc4c\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1007, in _search
agent.search(*f_args, **f_kwargs)
File "M:\Plex\Plex Media Server\Plug-ins\PhoenixAdult.bundle\Contents\Code\__init__.py", line 616, in search
results = PAsearchSites.networkNubiles.search(results,encodedTitle,title,searchTitle,siteNum,lang,searchByDateActor,searchDate, searchSiteID)
File "M:\Plex\Plex Media Server\Plug-ins\PhoenixAdult.bundle\Contents\Code\networkNubiles.py", line 12, in search
titleNoFormatting = searchResult.xpath('//a[@class= "title"]')[0].text_content().strip()
File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-36236cc4c\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 108, in <lambda>
_getitem_ = lambda x, y: x.__getitem__(y),
IndexError: list index out of range
The last line of the error says list index out of range. this means we provided a list that was shorter than the code was expecting (often it is empty completely)
Look at the next line up. It tells us there is an issue with line 12 in networkNubiles.py and gives us the line. titleNoFormatting = searchResult.xpath('//span[@class="title"]/a')[0].text_content().strip()
A few lines up again and we can see the page the script was looking at
https://nubiles-porn.com/video/website/23/date/2015-12-18/2015-12-18
Heres how I resolve it. Go to the page it is looking at. Based on context you should be able to tell it is correct (not a bad URL etc) Press ctrl+shift+i or right click inspect to inspect the page
Using the chropath chrome extension or an equivalent xpath browser check what the existing code is returning
In this example //a[@class="title"]
doesn't give any results so there must have been a site change.
By right clicking an inspecting specifically on the title under the poster for the appropriate scene we can hopefully start to browse the right area of the webpage content.
By hovering over different elements we can see what is being highlighted on the page to the left to find the right section. in this case figcaption seems to contain the title
By expanding out the elements below figcaption we now see that in the a element does not have a class of "title" any more but the //span element above it does.
Using the chropath chrome extension or an equivalent xpath browser we can check if the xpath will return the correct results or we need to be more specific.
//span[@class="title"]
does give some results (one in this case)
the title is still nested in a lower /a element though so the final part is adding /a to the end.
By replacing //a[@class="title"]
with //span[@class="title"]/a
we have resolved the issue.