RSS Polling: read the video description from YouTube channel feeds

We import several YouTube channels into a forum category with RSS Polling. Each topic gets the video URL, which oneboxes into the player, but the video’s description never makes it into the post. For many videos the description is the actual content - route, location, gear, links - and members ask for it.

YouTube channel feeds are Atom with Media RSS extensions, and every entry carries the full description in <media:group><media:description>, along with <media:thumbnail>. RSS Polling parses feeds with the rss gem (0.3.3, Gemfile.lock#L614), which has no Media RSS module, so these elements are dropped before FeedItem sees them, and YouTube items fall back to the bare URL (feed_item.rb#L17-L23).

What would help:

  1. Read media:description (and media:thumbnail) for YouTube entries.
  2. A per-feed or site-wide option to include the description below the video in the imported post.

We currently do this in a small companion plugin by re-reading the feed XML during the poll (discourse-rss-onebox). It works across the topics on our forum, but it depends on RSS Polling internals and would be simpler and sturdier in core.

1 Like

does the rss gem support the media rss extensions? if so, i’d be happy to review and merge a pull request upgrade the rss gem and adding support for those media extensions :+1:

1 Like

Checked: no. Neither the version Discourse bundles (0.3.3) nor current master of ruby/rss (0.3.4) has a Media RSS module - it ships content, Dublin Core, image, iTunes, slash, syndication, taxonomy and trackback, and ignores media:* elements. So upgrading the gem alone won’t help.

Two ways I can see:

  1. Add a Media RSS module to ruby/rss upstream (along the lines of its iTunes module), then bump the gem here.
  2. Read media:description from the raw XML with Nokogiri inside RSS Polling - the fetch step already has the XML before parsing, so no gem change is needed. That’s what our companion plugin does today, and it’s been reliable with YouTube channels.

Option 2 seems the smaller change. Would you take a PR along those lines?

1 Like