Revised AdultDVDEmpire plugin

It would REALLY be helpful if someone could take 20 seconds to explain how to find the .bundle, or create the bundle, of this agent.  I suspect the experts/code writers assume this is such an obvious answer that they don't want to bother explaining it.  Unforunately, there is no wiki for this, no pinned entry in this forum, and nowhere else I could find that explains simple things like:

- a listing of all available agents

- where to copy them to (that's been explained in this thread so thanks for that)

- whether you can just copy the code in this thread and save it with some filename, and move it to the destination, and expect it to work

- whether the code displayed in this thread is an addition to, or modification of, some existing file that we need to modify, since it is implied at the start of this thread that this is a modification.

Many thanks

p.s.  If my posting annoys you, please add a comment so I know why it does, rather than simply ignore this posting along with the previous requests for basic information.

I second this. I have wasted a good amount of time trying to figure this one out by myself.

I will be nice if someone can post a zip file or a working git link.

- a listing of all available agents

The best you can do is go into the Channel Directory, select the More... option and then Metadata Agents. Those are the "official" agents you can install. Anything else you find on this forum or elsewhere on the web is not really supported and it's up to the authors of those agents to provide some info about it.
 

[...] I suspect the experts/code writers assume this is such an obvious answer that they don't want to bother explaining it.

The reason why there isn't much explaining in this thread is because it's in the Developers part of the forum. Code posted and discussed in here is usually not release ready or complete.

As far as I can tell this is still working.  

Attached is a zip of the 'bundle', To install unzip this into your plex plugins directory - in windows you can get there by right clicking the PMS notification icon and selecting "Open Plug-ins Folder..."

 I know VERY litlle about plex plugins and only a little bit of the programming involved, so I really won't be able to answer any questions, but this should be better than nothing.

The fetcher is busted.  No retrieving anything anymore.  Is the author still around here and maintaining this agent?

Anyone?

Worked for me, but I had to instruct Plex to use this plugin spesifically, otherwise I got a completely wrong match.

Just a litlle update to get this fully working again.

# AdultDVDEmpire
# Update: 15th September 2014 

URLS

ADE_BASEURL = ‘http://www.adultdvdempire.com
ADE_SEARCH_MOVIES = ADE_BASEURL + ‘/dvd/search?q=%s’
ADE_MOVIE_INFO = ADE_BASEURL + ‘/%s/’

def Start():
HTTP.CacheTime = CACHE_1DAY
HTTP.SetHeader(‘User-agent’, ‘Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)’)

class ADEAgent(Agent.Movies):
name = ‘Adult DVD Empire’
languages = [Locale.Language.English]
primary_provider = True

def search(self, results, media, lang):
title = media.name
if media.primary_metadata is not None:
title = media.primary_metadata.title

query = String.URLEncode(String.StripDiacritics(title.replace('-','')))
# Finds div with class=item
for movie in HTML.ElementFromURL(ADE_SEARCH_MOVIES % query).xpath('//p[contains(@class,"title")]/a'):
  # curName = The text in the 'title' p
  curName = movie.text_content().strip()
  if curName.count(', The'):
    curName = 'The ' + curName.replace(', The','',1)

  # curID = the ID portion of the href in 'movie'
  curID = movie.get('href').split('/',2)[1]
  score = 100 - Util.LevenshteinDistance(title.lower(), curName.lower())
  if curName.lower().count(title.lower()):
    results.Append(MetadataSearchResult(id = curID, name = curName, score = 100, lang = lang))
  elif (score >= 95):
    results.Append(MetadataSearchResult(id = curID, name = curName, score = score, lang = lang))

results.Sort('score', descending=True)

def update(self, metadata, media, lang):
html = HTML.ElementFromURL(ADE_MOVIE_INFO % metadata.id)
metadata.title = media.title

# Thumb and Poster
try:
  img = html.xpath('//div[@id="Boxcover"]/a/img[contains(@src,"m.jpg")]')[0]
  thumbUrl = img.get('src')
  thumb = HTTP.Request(thumbUrl)
  posterUrl = img.get('src').replace('m.jpg','h.jpg')
  metadata.posters[posterUrl] = Proxy.Preview(thumb)
except:
  pass

# Tagline
try: metadata.tagline = html.xpath('//p[@class="Tagline"]')[0].text_content().strip()
except: pass

# Summary.
try:
  metadata.summary = html.xpath('//div[@class="Section Synopsis"]/p[3]')[0].text_content().replace('	','').strip()
  if metadata.summary.find("Synopsis") != -1:
    metadata.summary = metadata.summary.replace("Synopsis", '').strip()
  if metadata.summary.find(metadata.tagline) != -1:
    metadata.summary = metadata.summary.replace(metadata.tagline, '').strip()
except: pass

# Product info div
data = {}
productinfo = HTML.StringFromElement(html.xpath('//div[@class="Section ProductInfo"]')[0])
productinfo = productinfo.replace('<strong>', '|')
productinfo = productinfo.replace('</strong>', ':').split('<h2>Detail</h2>')
productinfo = HTML.ElementFromString(productinfo[1]).text_content()

for div in productinfo.split('|'):
  if ':' in div:
    name, value = div.split(':')
    data[name.strip()] = value.strip()

# Rating
if data.has_key('Rating'):
  metadata.content_rating = data['Rating']

# Studio	  
if data.has_key('Studio'):
  metadata.studio = data['Studio']

# Release	  
if data.has_key('Released'):
  try:
    metadata.originally_available_at = Datetime.ParseDate(data['Released']).date()
    metadata.year = metadata.originally_available_at.year
  except: pass

# Cast
try:
  metadata.roles.clear()
  htmlcast = html.xpath('//a[contains(@class, "PerformerName")]')
  for cast in htmlcast:
    cname = cast.text_content().strip()
    if (len(cname) > 0):
      role = metadata.roles.new()
      role.actor = cname
except: pass

Thanks, it does work, but could you - like the original revised one - add the possibility to search for scenes?

Can someone verify that this is not working and point me to the updated bundle

Not working for me, I *think* I have the latest version? "# Update: 15th September 2014", can anyone confirm? The ExcaliburFilms agent works ok but doesn't get everything, and even if it finds the title, it doesn't always get a poster for some reason

It doesn't work anymore for me neither...

I sent them an email... I'll forward the answer ;-)

  • bump
  •  

Ok, here’s an update to get the plugin working. enjoy

Added the projects to GitHub:


works fine so far, but the cover images still dont download automaticly :frowning:

Yeah images not working…please fix

bump on this

The search is working but no images or metadata is downloading :frowning:

ADE plugin horribly broken. In need of major update. They recently did a complete redesign of the site and its broken all the plugin capability… sadly…

Hey there!

As I had nothing better to do tonight, I decided to look into the way Plex agents work, so I did a fork of the agent andieuk did, and made a few fixes for the parsing of metadata like studio, actors and yes - the poster image.

It’s available here: GitHub - jesperrasmussen/AdultDVDEmpire.bundle: Plex metadata agent for fetching metadata for AdultDVDEmpire material.

Let me know, if there are any issues with this - and I’ll have a look at it :slight_smile: