Req: A little help with a picture plug-in

Yup. Me too...
So I decided to take a dive at it. I figured modifying an existing plug-in couldn't be too hard and started changing a few bits. And it seems it's not that easy...

This is my log output. Does it mean that it goes through all the elements in the feed? I've tried and tried for hours, but I just can't figure out what I'm doing wrong.
![post-2395-1235767613.png|690x257](upload://lB5vIRSTclRFvuBNqfbvLeyF5fp.png)

And this is the main part of my code:


from PMS import Plugin, Log, DB, Thread, XML, HTTP, JSON, RSS, Utils<br />
from PMS.MediaXML import MediaContainer, DirectoryItem, PhotoItem<br />
<br />
PLUGIN_PREFIX   = "/photos/opet.tumblr"<br />
RSS_FEED		= "feed://opet.tumblr.com/rss"<br />
<br />
################################################################################<br />
####################<br />
def Start():<br />
  Plugin.AddRequestHandler(PLUGIN_PREFIX, HandlePhotosRequest, "opet.tumblr", "icon-default.png", "art-default.png")<br />
  Plugin.AddViewGroup("Pictures", viewMode="ImageStream", contentType="photos")<br />
<br />
################################################################################<br />
####################<br />
def HandlePhotosRequest(pathNouns, count):<br />
  dir = MediaContainer("art-default.png", "Pictures", "opet.tumblr")<br />
  <br />
  if count == 0:<br />
	for item in RSS.Parse(RSS_FEED).entries:<br />
	  node = XML.ElementFromString(item.description[0].value, True)<br />
	  img = node.xpath("//img")[0].get('src')<br />
	  dir.AppendItem(PhotoItem(img, item.title, '', img))<br />
<br />
  return dir.ToXML()



I know this is probably **really** simple, but I just can't grasp it.

Cheers!


try http:// instead of feed://

Thanks for the quick reply.



But no luck. Still just the same blank page in Plex and the same output in console. The log isn’t really helping… :slight_smile:



Any specific things I’ve done wrong. I also changed the original script from “item.content[0].value” to item.description[0].value" as I don’t have a content tag in my feed.

It’s failing for several reasons. If you look at the source of your RSS feed, the description of the first element contains HTML embed code for a YouTube video, so description[0] is returning the first character of the string: “<”. Even if it got past that point, there is no “img” tag in the HTML, so that part wouldn’t work either.



You can’t simply apply the same method for one plug-in to a completely different site - each plug-in has to be tailored to the way the site presents its’ data. I don’t really see how the code you posted above relates to the feed it’s requesting.

Sorry. I feel stupid now.



I just discovered that I could add videos to my tumblr feed. Completely forgot that I had it in there. I got rid of everything but the images through yahoo pipes.



The second problem was feed:// . Didn’t know that safari exchanged the http:// prefix when read.



The third problem was the XML.ElementsFromString(item.description[0].value, True). with (item.summary, True) , everything works. But why? I don’t have a summary node in my feed. All the html is inside the description node. Anyone care to enlighten me?



Cheers anyway!


RSS.Parse(RSS_FEED).entries does not return "XML items" but "RSS items" -> [http://www.feedparser.org/](http://www.feedparser.org/)