What is the current status of media enclosure support in Drupal?

It is suprising that the Aggregator.module does not read enclosures since podcasting and video blogging relies on enclosures.

I realize this question has been asked more than a few times in the past, but I have yet to find a recent (4.7) solution...
http://drupal.org/search/node/aggregator+enclosure

Comments

boris mann’s picture

Attach a file using the core upload.module. The first file gets turned into an enclosure, and everyone that you give permission to attach files can now video blog/podcast.

Aggregator does not support incoming enclosures, which is what you seem to be asking about. If you're trying to build a podcasting/video blogging aggregator, you might look at Aggregator2, which I believe was making some steps to add the ability to suck in enclosures.

geohelper’s picture

I'm thinking more about using aggregator as is (reading 3rd party feeds), but it should be looking for enclosures too. These media files would then be linked on the standard /aggregator page (something like how Bloglines has an "Enclosure" link below posts w/ linked media). It would also be critical to add the correct enclosure tagging in the /aggregator/feed file for re-syndication.

On a somewhat related note, I'd like to be able to work this into some of my custom modules. I already have a database column for the enclosure url, but I'm not sure how to get the extra enclosure tage inserted into the feed properly using the existing function...

$channel['title'] = variable_get('site_name', 'drupal') . " - " . $account->name . "'s media";
$channel['link'] = url('example', NULL, NULL, TRUE);
$channel['description'] = $term->description;
node_feed($result, $channel);
Veggieryan’s picture

I will throw down cash to see this happen.
I can't believe its not built in.
We should be able to aggregate anything!

here here!
who can help us:?
thanks
ryan.
thefractal.org

geohelper’s picture

I too would throw down money for this support.

budda’s picture

Guys - i've been looking at this and have so far worked on getting the enclosure out of the feeds being parsed into Drupal.

My idea (and i'm open to alternative suggestions here) is to provide aggregator.module with an API so that contrib modules have access to all the feed data as a new item is parsed in.

So your module could react to an enclosure found with an item, and either download it to the local server, or store the url/type/length in a dbase table etc.

Using the same aggregator API it would also be possible to create categories in Drupal's taxonomy based on categories used in aggregator feed items. Much in the same way that I did with Aggregator2's Autotaxonomy module.

I'm working on it on and off as I don't have a direct requirement for it myself actuall. Just noticed it was a missing feature the other night.

I'm open to offers if you'd like to get something done quickly?

--
Drupal consultancy

geohelper’s picture

That sounds great! I finally got back around to this and have a hack started. Your method sounds much better. I'm very surprised that this is not integrated into 4.7 by default.

sepeck’s picture

If no one worked on it, then it doesn't get done. As 4.8 is open, now is the time to be making code for the next version of Drupal's included features so it reduces surprise.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

sethcohn’s picture

I'd love to aggregator _external_ mp3 feeds, without attempting to store the mp3s locally.

What I really want is something that will see the enclosure, and put a link in the display of the rss feed node/block/page/etc.

Need Drupal friendly hosting? Many of us use Site5 with good results

geohelper’s picture

Exactly. Reading the external locations of media enclosures would be a big addition for Drupal. It basically offers the ability to create "channels" of community content by reading external feeds. It should be fairly basic to read these tags from a feed, save them in the database and display them in the aggregator list.

The aggregator_parse_feed() function is where it loops through the RSS items, but can someone provide insight on the recommended method for debugging variables?...

I've tried adding echo() and die() statements in the aggregator.module, but they do not appear when I hit the /cron.php file. It'll die, but nothing will display.

//... from aggregator_parse_feed()
$enclosure = "";
if ($item['ENCLOSURE']) {
  $enclosure = $item['ENCLOSURE'];
  $enclosure = "enclosure<br />\n" . $enclosure;
}
else if ($item['MEDIA:CONTENT']) {
  $enclosure = $item['MEDIA:CONTENT'];
  $enclosure = "media:content...<br />\n" . $enclosure;
}
die($enclosure);

Then this data just needs to be added to the aggregator_save_item() function.

Technically, $item['ENCLOSURE'] and $item['MEDIA:CONTENT'] will require a different syntax to get the url attribute. The above would work if the data were in between tags. I'm assuming Drupal uses PHP's SimpleXML functions... http://us3.php.net/simplexml

designerbrent’s picture

Just wondering if you have made any headway on this issue? I'm interested in enclosure support also. Let me know what you have figured out.

budda’s picture

I'm putting together a working idea of all this in the Feedparser module before anything goes near Core, if ever.

seaneffel’s picture

But tell me how I can contribute to this Feedparser module. This is what I am looking to implement on our community media website. Please let me know how I can help!

Sean
Cambridge Community Television
http://www.cctvcambridge.org

geohelper’s picture

Yeah, I hacked the aggregator.module file and the database to add support for the eclosure's url, length and type. I'm still working on adding georss data, but that isn't being used in many feeds.

Will White’s picture

I could be wrong but I don't think Drupal uses simpleXML because it only is available with PHP 5.

RobRoy’s picture

I worked on some aggregator2_enclosure.module and audio_remote.module that are in my sandbox currently. They work for my site MP3PIG, but I can't recall how specific my implementation was as I haven't touched them in a while.

These aren't currently a priority for me as I've got the real job to take care of ATM, but if anyone is interested in contributing to this, contact me through my contact form as I'd like to make a more generic and flexible solution.

--
Rob
Founder and Director
Electronic Insight Corporation

Recent Drupal Projects: MP3PIG | MySpace Layouts

armandoleon’s picture

This was my solution to the problem:
http://drupal.org/node/133288