erik_mitchell
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2013
12:58 PM
MRSS and Thumbnail Images
First time poster, but have used the forums to learn quite a bit so far.. Thanks for sharing!
I started with the MRSS template, and have everything working pretty well except for thumbnails. It's just using the image from the config, not the one specific in the rss feed. Any tips?
Here's the code included with the template:
Here's a sample from my rss feed:
I started with the MRSS template, and have everything working pretty well except for thumbnails. It's just using the image from the config, not the one specific in the rss feed. Any tips?
Here's the code included with the template:
' thumbnail
tmp = item.GetNamedElements("media:thumbnail")
if tmp.Count() > 0
newItem.sdPosterURL = ValidStr(tmp[0]@url)
newItem.hdPosterURL = ValidStr(tmp[0]@url)
else if xml.channel.image.url.Count() > 0
newItem.sdPosterURL = ValidStr(xml.channel.image.url.GetText())
newItem.hdPosterURL = ValidStr(xml.channel.image.url.GetText())
end if
Here's a sample from my rss feed:
<item>
<title>File 1</title>
<link>http://test.com</link>
<description>This is a great episode.</description>
<pubDate>Sun, 02 Jun 2013 11:00:00 -0000</pubDate>
<guid isPermaLink="false">UIj8YptI</guid>
<enclosure url="http://content.bitsontherun.com/videos/UIj8YptI-EAJYb5n4.mp4" length="1006319379" type="video/mp4" />
<itunes:author>HCC</itunes:author>
<itunes:duration>3763</itunes:duration>
<itunes:keywords>Test</itunes:keywords>
<media:content url="http://content.bitsontherun.com/videos/UIj8YptI-EAJYb5n4.mp4" type="video/mp4" duration="3763.90" fileSize="1006319379">
<media:thumbnail url="http://content.bitsontherun.com/thumbs/UIj8YptI-720.jpg" />
<media:credit>HCC</media:credit>
<media:player url="http://test.com/message/part-1-on-becoming-wise/" />
<media:keywords>Test</media:keywords>
</media:content>
</item>
7 REPLIES 7
erik_mitchell
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2013
02:18 PM
Re: MRSS and Thumbnail Images
I made a change to the config for where the image comes from for that outline, but the graphics within the feed did not change. So I thought about it a little more, and it appears that each item is using the graphic from the itunes 'channel' metadata. Shouldn't it be using the thumbnail from each individual item, and not from the one here?
<channel>
<title>HCC</title>
<link>http://test.com</link>
<description>Testing</description>
<image>
<url>http://content.bitsontherun.com/thumbs/ktUszevN-120.jpg</url>
<title>HCC HD</title>
<link>http://www.test.com</link>
</image>
<itunes:author>HCC</itunes:author>
<itunes:keywords>Messages</itunes:keywords>
<itunes:image href="http://content.bitsontherun.com/thumbs/ktUszevN.jpg" />


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2013
02:43 PM
Re: MRSS and Thumbnail Images
"erik.mitchell" wrote:
it appears that each item is using the graphic from the itunes 'channel' metadata. Shouldn't it be using the thumbnail from each individual item, and not from the one here?
If you look at the thumbnail parsing logic you posted, it first checks for a media:thumbnail element subordinate to the item element. If it doesn't find one, it checks for a channel.image.url element and uses that if it exists. That's the behavior you're seeing.
Your media:thumbnail elements are subordinate to a media:content element, which your parsing logic is not looking for. You can modify the parsing logic to look one level deeper for the thumbnail or you could move the thumbnail element up a level in your MRSS. Either should fix your issue.
erik_mitchell
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2013
02:59 PM
Re: MRSS and Thumbnail Images
That makes total sense. I didn't even pay attention to it being under content.
I've tried looking around the forum, and unless I'm using the wrong search terms, can't find an explanation for how to parse deeper.. Tried a few things I made up, they didn't work..
Thank you!
I've tried looking around the forum, and unless I'm using the wrong search terms, can't find an explanation for how to parse deeper.. Tried a few things I made up, they didn't work..
Thank you!
erik_mitchell
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2013
09:29 AM
Re: MRSS and Thumbnail Images
Any tips on parsing the multilevel nest 1 level down?


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2013
10:21 AM
Re: MRSS and Thumbnail Images
Yahoo seems to have (re)moved the MRSS spec, so I can't link to it from here. If memory serves, the spec allows for an item to have multiple media:content elements and each of those may have multiple media:thumbnail elements. So you need a couple loops to step through them all and maybe some additional logic to decide which to use if you find more than one.
This is untested from memory, so you may have to tweak it here and there to get the desired result.
This is untested from memory, so you may have to tweak it here and there to get the desired result.
for each item in rss.channel.item ' stepping through items within the MRSS
mediaContents = item.GetNamedElements("media:content")
for each mediaContent in mediaContents ' stepping through media:content within an item
mediaThumbnails = mediaContent.GetNamedElements("media:thumbnail")
for each mediaThmbnail in mediaThumbnails ' stepping through media:thumbnail within a media:content
? "found thumbnail: " + mediaThumbnail@url
next
next
next
erik_mitchell
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2013
11:06 AM
Re: MRSS and Thumbnail Images
Thanks for the tip. Here's where I ended up, in case anyone else has the same issue..
It's a little slow to load the images, but it's doing some scaling down from the original image size, so maybe i'll come back to that. Just happy to have it working.
It's a little slow to load the images, but it's doing some scaling down from the original image size, so maybe i'll come back to that. Just happy to have it working.
' thumbnail
mediaContentList = item.GetNamedElements ("media:content")
tmp = mediaContentList [0].GetNamedElements("media:thumbnail")
if tmp.Count() > 0
newItem.sdPosterURL = ValidStr(tmp[0]@url)
newItem.hdPosterURL = ValidStr(tmp[0]@url)
else if xml.channel.image.url.Count() > 0
newItem.sdPosterURL = ValidStr(xml.channel.image.url.GetText())
newItem.hdPosterURL = ValidStr(xml.channel.image.url.GetText())
end if
virtualCableTV
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2013
01:40 PM
Re: MRSS and Thumbnail Images
The reason why the Yahoo! MediaRSS page is dead is because MediaRSS has been transferred to the RSS Board where the specs are at: http://www.rssboard.org/media-rss