If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

[adult] Kink.com metadata agent

vofikvofik Posts: 15Members ✭✭
Adult Sites and Porn Stars

Happy New Year present for any fans of Kink.com sites

Code here: https://github.com/vofik/Kink.bundle

Download here: https://github.com/vofik/Kink.bundle/zipball/master

I could not figure out how to get it to assign actors to tv series episodes, so it matches them as movies, not a tv show episode.

Kink does not list genres for shoots, so no genres are assigned.

Kink.com episode search by actor name doesn't really work, so the matching works by episode id - the only requirement is that the filename begins with the numeric shoot id from kink.com

Feel free to fork and suggest improvements

 

Version 2.0 UPDATED.

«1

Comments

  • matrixagentmatrixagent Posts: 155Members, Plex Pass Plex Pass

    Is anyone using this? I've done a lot of improvements on this the last few days. If there's any interest in it, I'd be happy to share it. In that case I would want to add a few more checks and comments here and there, though… ;)

  • matrixagentmatrixagent Posts: 155Members, Plex Pass Plex Pass
    edited November 2013

    Alright, as I received several private messages I guess there is some demand. :)

    I've put my current status up on Github: https://github.com/matrixagent/Kink.bundle

    Here's a list of all the changes I did:

    • Removed/updated some legacy code that would cause warnings in the logfile
    • The site (e.g. DeviceBondage or Hogtied) is now set as the "movie studio", previously it would always just be "Kink.com". This allows for awesome sorting/grouping by site.
    • The title is no longer in the format "$sitename - $episodeid", but now actually also retrieved from the shoot info in the website. The episode ID is still appended in brackets for easy reference. Additionally, the tagline is set to "sitename - $episodeid". Example screenshot.
    • Instead of just fetching one of the images as the movie poster, it now is a] fetching all available images, and b] fetches them in the highest quality possible. The one image that the shoot site is using as their primary/showcase picture is set as the poster, the other images are set as "art", so they'll be used as backdrops.
    • Genres were completely removed as there are none stated on the website. I might come back to this and do some keyword extraction on the summary to try and find out possible genres.
    • In addition to actors, the director of an episode is now also added automatically.

    That's all for now, it should work very reliable, I've tested it on a few hundred files from many different sites.

    Filenames have to begin with the episode ID! The files must not be in subdirectories.

    I think especially the subdirectories thing can be worked around, but for now it has to be this way.

    I'm hoping to be able to extend the functionality to some related/similar sites that don't belong to kink.com in the coming days (e.g. hardtied, infernal restraints). These do not use shoot IDs and are thus harder to process, but I've got an idea how to do it.

    Please let me know how it works for you. If you have problems, please also let me know the shoot ID so I can try to reproduce the problem.

    If you have any ideas on what could still be improved, I'd love to hear it. Currently I don't really see any info from the website that is not yet used in some way, but maybe you can think of something.

  • vofikvofik Posts: 15Members ✭✭

    @matrixagents: nice work, can you send a pull request with your changes, I'll merge them back in :)

    Do you have any idea about assigning actors to episodes, does that work now? I was not able to get it to work in my original code.

  • matrixagentmatrixagent Posts: 155Members, Plex Pass Plex Pass
    vofik wrote on November 24 2013, 11:52 PM: »

    @matrixagents: nice work, can you send a pull request with your changes, I'll merge them back in :)

    You got it! :) Let me know if that works for you, I've had to include the readme as well it seems.

    vofik wrote on November 24 2013, 11:52 PM: »

    Do you have any idea about assigning actors to episodes, does that work now? I was not able to get it to work in my original code.

    Sadly not, TV show agents are still a miracle to me in general. I might have another look some time, but for now I'm more than happy enough with the solution to use the website as studio and distinguish that way.

    Regarding my announcement of trying to get other sites not from the Kink empire to work as well: in theory it's working, it's very hard to find a good identifier, though. Currently I'm trying parsing Google results for the filename and a little magic, but the accuracy is about 50 to 70 percent at best, I'm not really happy with that recognition rate. If a file is correctly recognized, the metadata is grabbed perfectly fine, however they all don't offer actor names in a parsable way, which lessens the value of the metadata quite a bit in my opinion.

  • techdragontechdragon Posts: 11Members Plex Pass

    Looks like you duplicated a lot of my private fixes. I also sent some pull requests to the plex server project itself for other metadata scraping oddness i discovered along the way.  Ill have to look up my code & see if I have any improvements I can make a pull request to your repo for.

    As for other metadata agents, I'm going to write a meta agent that can fall call on the various ones already available... that and I'm slowly inching towards building my own MetaData DB... I know its overkill, but I need an excuse to play more with Neo4j.

  • GlennDelmotteGlennDelmotte Posts: 31Members, Plex Pass Plex Pass

    How can i figure out the episode id?

  • blastactionheroblastactionhero Posts: 18Members, Plex Pass Plex Pass
    @glenn - at the end of the video the id is shown

    @developers: any news on the merging of both bundles? Somehow I can only use the bundle from the AppStore - the one with genres isn't working. Any chance of updating the scraper in the store? Thanks!


    Sent from my iPad using Tapatalk
  • liminalliminal Posts: 5Members, Plex Pass Plex Pass

    Here's a suggestion:

    If you change 

    episodeMatch = re.match(r'(\d{3,})', title)
    

    to

    episodeMatch = re.match(r'(?:[A-Za-z]{2,4}-)?(\d{3,})', title)
    

    You will allow for the rather common practice of naming the video files with a prefixed ID like WP-5839, DB-4181 or SAS-4267

  • vofikvofik Posts: 15Members ✭✭
    matrixagent wrote on December 11 2013, 4:21 PM: »

    You got it! :) Let me know if that works for you, I've had to include the readme as well it seems.

    Sadly not, TV show agents are still a miracle to me in general. I might have another look some time, but for now I'm more than happy enough with the solution to use the website as studio and distinguish that way.

    Regarding my announcement of trying to get other sites not from the Kink empire to work as well: in theory it's working, it's very hard to find a good identifier, though. Currently I'm trying parsing Google results for the filename and a little magic, but the accuracy is about 50 to 70 percent at best, I'm not really happy with that recognition rate. If a file is correctly recognized, the metadata is grabbed perfectly fine, however they all don't offer actor names in a parsable way, which lessens the value of the metadata quite a bit in my opinion.

    Oh man, I'm so sorry, I haven't been back to the forum in almost a year, completely forgot to check. Thanks for the pull request, I've merged your changes and bumped the version number so that everyone using the app store should get the improvements.

    TechDrgn wrote on December 19 2013, 7:02 AM: »

    Looks like you duplicated a lot of my private fixes. I also sent some pull requests to the plex server project itself for other metadata scraping oddness i discovered along the way.  Ill have to look up my code & see if I have any improvements I can make a pull request to your repo for.

    As for other metadata agents, I'm going to write a meta agent that can fall call on the various ones already available... that and I'm slowly inching towards building my own MetaData DB... I know its overkill, but I need an excuse to play more with Neo4j.

    Thanks for your pull requests as well.

    liminal wrote on September 13 2014, 4:04 PM: »

    Here's a suggestion:

    If you change 

    episodeMatch = re.match(r'(\d{3,})', title)
    

    to

    episodeMatch = re.match(r'(?:[A-Za-z]{2,4}-)?(\d{3,})', title)
    

    You will allow for the rather common practice of naming the video files with a prefixed ID like WP-5839, DB-4181 or SAS-4267

    Done, and pushed. Thanks!

  • rexorientrexorient Posts: 2Members, Plex Pass Plex Pass

    I was using the version the matrixagent did.  Once you bumped the version number I got updated to your new version.... which doesn't work.   Most/all movies I tried will throw an exception like this:

    2014-10-07 07:21:23,200 (1ac4) :  DEBUG (networking:167) - Fetching 'http://www.kinkondemand.com/kod/shoot/36045' from the HTTP cache
    2014-10-07 07:21:23,230 (1ac4) :  CRITICAL (core:572) - Exception in the update function of agent named 'Kink.com', called with guid 'com.plexapp.agents.kink://36045?lang=en' (most recent call last):
      File "C:\Users\Foobar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 981, in _update
        agent.update(obj, media, lang)
      File "C:\Users\Foobar\AppData\Local\Plex Media Server\Plug-ins\Kink.bundle\Contents\Code\__init__.py", line 51, in update
        metadata.genres = series
      File "C:\Users\Foobar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\attributes.py", line 31, in __setattr__
        self._attributes[name]._setcontent(value)
      File "C:\Users\Foobar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\attributes.py", line 631, in _setcontent
        ContainerObject._setcontent(self, content)
      File "C:\Users\Foobar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\modelling\attributes.py", line 244, in _setcontent
        raise Framework.exceptions.FrameworkException("Container-type attributes can't be assigned directly.")
    FrameworkException: Container-type attributes can't be assigned directly.
    
    

    Commenting out lines 51 and 52 fixes this problem.  (Series doesn't work, and director is already handled by the last code block.)

  • eenikadeenikad Posts: 1Members, Plex Pass Plex Pass

    I've extended the functionality of the plugin to work with intersec sites. It's far from perfect! The filenames have to be of a certain format. But for me it's working.
    Just wanted to inform you that I used your code for the kink.com stuff.

    Don't know but maybe the plugin is good enough to merge it with yours.

    https://github.com/eenikad/KinkIntersec.bundle/

    Feel free to use it - or extend it

  • lnxcwbylnxcwby Posts: 2Members, Plex Pass Plex Pass

    This stopped working a few weeks ago, due to changes on the kink.com site. Any help fixing it would be greatly appreciated. I'm not savvy enough in python to get it done.

  • ycorycor Posts: 2Members

    Hi, I have updated this bundle for the new Kink.com layout.

    You can download here: https://github.com/yh/Kink.bundle/archive/patch-1.zip

    Or check the code here: https://github.com/yh/Kink.bundle/tree/patch-1

  • BelgianDomBelgianDom Posts: 3Members

    I'm working on a new agent which supports all the Kink.com and Intersec websites.

    Unlike the existing Kink/Intersec agents, the new agent doesn't require you to rename the file with the episode id. Just copy the file to the right Plex folder and the agent will find the correct metadata for it. (It finds metadata based on website, date, episode ID, and title/model information derived from the filename, which is almost always sufficient to get an accurate match.)

    The agent is designed to be extensible, making it easy to add other websites going forward.

    Download: https://github.com/BelgianDom/PlexAdultMetadata.bundle/archive/master.zip

    Code: https://github.com/BelgianDom/PlexAdultMetadata.bundle

    Not all kink.com channels/websites are supported yet, but the remainder will be added in the next few days. Any and all feedback highly appreciated!

  • BelgianDomBelgianDom Posts: 3Members

    URLs have changed and I can't seem to edit the post....

    Code: https://github.com/BelgianDom/PlexAdultMetadata
    Download: https://github.com/BelgianDom/PlexAdultMetadata/archive/master.zip

    All of kink.com channels are now implemented.

  • pjlaskeypjlaskey Posts: 4Members, Plex Pass Plex Pass
    edited January 5

    This does not seem to do anything for me. I have my library in folders named according to the plug-in documentation and filenames all include the shoot ID (I did a lot of work in the old days too). The agent runs but no metadata is entered for my files. I tried creating a whole new library with no luck. There are no errors, it just doesn't do anything. Manually searching for these videos on kink.com/shoot/##### (or #### as appropriate) works just fine. Not sure what is failing.

    I have a couple of questions:

    • Is this meant to work with the Movie or Video scanner or both?
    • How do I troubleshoot this / view search results?

    I'm using Plex Media Server v1.3.3.3148 (PlexPass) on Windows Server 2008 R2 Standard x64.

    Thank you!

  • pjlaskeypjlaskey Posts: 4Members, Plex Pass Plex Pass

    Sample plugin log entry for a single file:

    2017-01-04 15:07:33,805 (1084) : DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.agents.adultmetadata/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo2CnMyCmVuczQKbGFuZ2IwczYKbWFudWFsYjFzNwpwcmltYXJ5aTAKczcKdmVyc2lvbnIxCnM2Cmt3YXJnc3M1Ck1vdmllczEwCm1lZGlhX3R5cGU2CnMxNgoxYTY5ZmI1ODRlZGNhODgzczE3Cm9wZW5TdWJ0aXRsZXNIYXNoczgxCjE0NjQ5IEV2ZXJ5dGhpbmdidXR0IDExIDA4IDIzIE1pYSBMZWxhbmkgJiBJc2lzIExvdmUgTWlhIExlbGFuaSdzIEFuYWwgRG9taW5hdGlvbnM0Cm5hbWVzMTg5CiU1QyU1QzE5MiUyRTE2OCUyRTElMkUyNTIlNUNYRHJpdmUlNUNYWFhLaW5rJTJFY29tJTVDRVZFUllUSElOR0JVVFQlNUMxNDY0OSUyMEV2ZXJ5dGhpbmdCdXR0JTIwLSUyMDExLTA4LTIzJTIwTWlhJTIwTGVsYW5pJTIwJTI2JTIwSXNpcyUyMExvdmUlMjAtJTIwTWlhJTIwTGVsYW5pJ3MlMjBBbmFsJTIwRG9taW5hdGlvbiUyRW1wNHM4CmZpbGVuYW1lczQwCjNlMTZkMjllZWYyOTU4YTcwZDkyMmI4NWYzMTdhYzUzMDZlNDM4ZjJzOApwbGV4SGFzaHM3CjM0NzU0NDdzOApkdXJhdGlvbnM1CjMxMjQ5czIKaWRyMAo_
    2017-01-04 15:07:33,805 (1084) : DEBUG (runtime:49) - Received packed state data (2044 bytes)
    2017-01-04 15:07:33,811 (1084) : DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.agents.adultmetadata/messaging/function/X0FnZW50S2l0OlNlYXJjaA__/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoyCmRpY3QKZGljdAo2CnMyCmVuczQKbGFuZ2IwczYKbWFudWFsYjFzNwpwcmltYXJ5aTAKczcKdmVyc2lvbnIxCnM2Cmt3YXJnc3M1Ck1vdmllczEwCm1lZGlhX3R5cGU2CnMxNgoxYTY5ZmI1ODRlZGNhODgzczE3Cm9wZW5TdWJ0aXRsZXNIYXNoczgxCjE0NjQ5IEV2ZXJ5dGhpbmdidXR0IDExIDA4IDIzIE1pYSBMZWxhbmkgJiBJc2lzIExvdmUgTWlhIExlbGFuaSdzIEFuYWwgRG9taW5hdGlvbnM0Cm5hbWVzMTg5CiU1QyU1QzE5MiUyRTE2OCUyRTElMkUyNTIlNUNYRHJpdmUlNUNYWFhLaW5rJTJFY29tJTVDRVZFUllUSElOR0JVVFQlNUMxNDY0OSUyMEV2ZXJ5dGhpbmdCdXR0JTIwLSUyMDExLTA4LTIzJTIwTWlhJTIwTGVsYW5pJTIwJTI2JTIwSXNpcyUyMExvdmUlMjAtJTIwTWlhJTIwTGVsYW5pJ3MlMjBBbmFsJTIwRG9taW5hdGlvbiUyRW1wNHM4CmZpbGVuYW1lczQwCjNlMTZkMjllZWYyOTU4YTcwZDkyMmI4NWYzMTdhYzUzMDZlNDM4ZjJzOApwbGV4SGFzaHM3CjM0NzU0NDdzOApkdXJhdGlvbnM1CjMxMjQ5czIKaWRyMAo_
    2017-01-04 15:07:33,811 (1084) : INFO (agentkit:946) - Searching for matches for {'openSubtitlesHash': '1a69fb584edca883', 'name': "14649 Everythingbutt 11 08 23 Mia Lelani & Isis Love Mia Lelani's **** Domination", 'filename': "%5C%5C192%2E168%2E1%2E252%5CXDrive%5CXXXKink%2Ecom%5CEVERYTHINGBUTT%5C14649%20EverythingButt%20-%2011-08-23%20Mia%20Lelani%20%26%20Isis%20Love%20-%20Mia%20Lelani's%20Anal%20Domination%2Emp4", 'plexHash': '3e16d29eef2958a70d922b85f317ac5306e438f2', 'duration': '3475447', 'id': '31249'}
    2017-01-04 15:07:33,812 (1084) : DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/library/metadata/31249/tree'
    2017-01-04 15:07:33,819 (1084) : INFO (logkit:16) - Matcher.Find(14649 EverythingButt - 11-08-23 Mia Lelani & Isis Love - Mia Lelani's **** Domination.mp4, \192.168.1.252\XDrive\XXXKink.com\EVERYTHINGBUTT)
    2017-01-04 15:07:34,690 (1084) : INFO (logkit:16) - Matcher -- Result: Everything Butt
    2017-01-04 15:07:34,714 (1084) : DEBUG (networking:166) - Requesting 'http://www.kink.com/channel/everythingbutt/latest/page/1'
    2017-01-04 15:07:36,482 (1084) : INFO (logkit:16) - Matched date format YY.MM.DD: 14649 EverythingButt - 11-08-23 Mia Lelani & Isis Love - Mia Lelani's **** Domination.mp4
    2017-01-04 15:07:36,483 (1084) : INFO (logkit:16) - Words we look for: set([u'11', u'ISIS', u'23', u'MIA', u'EVERYTHINGBUTT', u'14649', u'DOMINATION', u'LELANI', u'S', u'MP4', u'LOVE', u'****', '2011', u'08'])
    2017-01-04 15:07:36,486 (1084) : DEBUG (runtime:88) - Sending packed state data (2077 bytes)
    2017-01-04 15:07:36,486 (1084) : DEBUG (runtime:924) - Response: [200] str, 320 bytes

  • pjlaskeypjlaskey Posts: 4Members, Plex Pass Plex Pass

    I have many (apparently) older episodes which only have four digit ID's. There are problems looking these up. Which of these is a better solution:

    1) Pre-append a zero to the ID ie 8460 -> 08460
    2) Modify code line 64
    FROM: shootIds = re.findall(r'\D*(\d\d\d\d\d)\D*', filename)
    TO: shootIds = re.findall(r'\D*([0-9]{4,5})\D*', filename)

  • BelgianDomBelgianDom Posts: 3Members

    Nice catch. Did you test out the latter? My vote would be to change the matcher because renaming the files seems like a PITA... however, it would also match the Year or any other 4 digits that the filename might have... so curious if you made that change and if it was an issue?

  • nymerosnymeros Posts: 2Members

    BelgianDom: The scraper does not reliably retrieve Kink.com data from shoots older than the ones that appear on /channel/{self.site}/latest so it is difficult to test if the 4-digit ID (and 3-digit ones exist as well) regex works.

    I had to change mine to shootIds = re.findall(r'\d((\d)\D*', filename) to match the naming convention I have of YYYY-MM-DD - Actors Here (ShootID).mkv but I have tried it with the default regex and renamed a few files to test (with limited success).

    There is also a conflict if two shoots from the same site are released on the same day. See 41315 and 41322 as an example. Both will always show as the same, presumably because a date hit is a '100%' match.

«1
Sign In or Register to comment.