PAhelper / PhoenixAdult.bundle

Plex Meta-Data Agent for scene videos from multiple adult sites
354 stars 142 forks source link

18OnlyGirls list index out of range #515

Closed ordinarygulp closed 4 years ago

ordinarygulp commented 4 years ago
2019-12-30 02:41:33,018 (153225e44700) :  INFO (__init__:44) - *******MEDIA TITLE****** 18onlygirls 16 05 17 Melena Maria
2019-12-30 02:41:33,018 (153225e44700) :  INFO (__init__:51) - Getting Search Settings for: 18onlygirls 16 05 17 Melena Maria
2019-12-30 02:41:33,018 (153225e44700) :  INFO (PAsearchSites:957) - mediaTitle w/ possible abbrieviation: 18onlygirls 16 05 17 Melena Maria
2019-12-30 02:41:33,028 (153225e44700) :  INFO (PAsearchSites:1146) - mediaTitle w/ possible abbrieviation fixed: 18onlygirls 16 05 17 Melena Maria
2019-12-30 02:41:33,031 (153225e44700) :  INFO (PAsearchSites:1161) - ^^^^^^^ siteID: 794
2019-12-30 02:41:33,032 (153225e44700) :  INFO (PAsearchSites:1163) - ^^^^^^^ Shortening Title
2019-12-30 02:41:33,032 (153225e44700) :  INFO (PAsearchSites:1164) - 18onlygirls vs 18onlygirls
2019-12-30 02:41:33,032 (153225e44700) :  INFO (PAsearchSites:1168) - 1
2019-12-30 02:41:33,032 (153225e44700) :  INFO (PAsearchSites:1187) - 7
2019-12-30 02:41:33,032 (153225e44700) :  INFO (PAsearchSites:1223) - searchTitle (before date processing): 16 05 17 Melena Maria
2019-12-30 02:41:33,033 (153225e44700) :  INFO (__init__:61) - Search Title: Melena Maria
2019-12-30 02:41:33,033 (153225e44700) :  INFO (__init__:65) - Search Date: 2016-05-17
2019-12-30 02:41:33,033 (153225e44700) :  INFO (__init__:70) - Melena%20Maria
2019-12-30 02:41:33,033 (153225e44700) :  INFO (siteGirlsWay:9) - SceneID: Melena
2019-12-30 02:41:33,033 (153225e44700) :  INFO (siteGirlsWay:14) - Scene Title: Maria
2019-12-30 02:41:33,035 (153225e44700) :  DEBUG (networking:138) - Fetching 'http://18onlygirls.tv/?s=Melena' from the HTTP cache
2019-12-30 02:41:33,038 (153225e44700) :  CRITICAL (agentkit:1014) - Exception in the search function of agent named 'PhoenixAdult', called with keyword arguments {'year': None, 'id': '130767', 'name': '18onlygirls 16 05 17 Melena Maria'} (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1007, in _search
    agent.search(*f_args, **f_kwargs)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/PhoenixAdult.bundle/Contents/Code/__init__.py", line 117, in search
    results = PAsearchSites.siteGirlsWay.search(results, encodedTitle, title, searchTitle, siteNum, lang, searchByDateActor, searchDate, searchSiteID)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/PhoenixAdult.bundle/Contents/Code/siteGirlsWay.py", line 17, in search
    titleNoFormatting = searchResult.xpath('//div[@class="titleBar"]/h1')[0].text_content().strip()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-ac2afe5f8/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
HWatBobby commented 4 years ago

Check your PAsearchSites file and make sure 18OnlyGirls has a unique siteID. Your log is showing it is trying to use the Girlsway file for the search, which is used for a site just below 18OnlyGirls in the list. You'll need to update your init file as well if that is the case with all the correct siteIDs.

ordinarygulp commented 4 years ago

I'm using your master branch :p This seems to be under the network 'AllFineGirls', although that site has no search. The url provided, https://18onlygirls.tv/?s=Melena works, even though the 'new trailer' items are in front of the actual result.

HWatBobby commented 4 years ago

OK, I think I found the issue. In the init file it has under the Girlsway entries Line 116 if searchSiteID == 9999 ..... or (794 <= searchSiteID <= 797): and Line 2000 if siteID == 53 or ..... or (siteID >= 794 and siteID <= 797):. 794 is 18OnlyGirls, so that would be why it is looking to the Girlsway file. If you change the 794 to 795 I would believe that should fix it. Let me know if that fixes it for you and I can make the changes in my branch.

ordinarygulp commented 4 years ago

https://github.com/PAhelper/PhoenixAdult.bundle/blob/master/Contents/Code/__init__.py#L116 https://github.com/PAhelper/PhoenixAdult.bundle/blob/master/Contents/Code/__init__.py#L1979

changing those both from 794 to 795 as suggested, gets search results to return. Albeit, very shitty search results, but as I said, that seems to be the site itself.

HWatBobby commented 4 years ago

Good to hear. I made the changes and added them to my current PR.

I see the site has a search function and that's how the plugin looks at the site, but it looks like the site can be changed to direct if the results aren't any good. The 18OG file code is pointing to all the correct locations on the pages, so it should be grabbing the Title, Actors, Summary, Tags, and Posters correctly.