I thought WP 3.6 had some utilities for extracting media from post_content.