import feedparser

from vidscraper.bulk_import import opensearch

IMPORTERS = (
    opensearch,
    )

def bulk_import(feed_url):
    """
    Takes a URL for a feed, and returns a feedparser instance with the entries
    filled in with all of the videos from that feed.  It'll take care of paging
    through videos from services like blip.tv and Vimeo or services which
    support OpenSearch (like YouTube).
    """
    parsed_feed = feedparser.parse(feed_url)
    for importer in IMPORTERS:
        if importer.video_count(parsed_feed) is not None:
            return importer.bulk_import(parsed_feed)

    # if we can't figure out how to bulk import the feed, just return the items
    # in the feed
    return parsed_feed


def video_count(feed_url):
    """
    Takes a URL for a feed, and returns the number of videos we think we can
    import from it.
    """
    parsed_feed = feedparser.parse(feed_url)
    for importer in IMPORTERS:
        count = importer.video_count(parsed_feed)
        if count is not None:
            return count

    return len(parsed_feed.entries)

@@ -112,35 +112,53 @@
 _import(feed_url
+, parsed_feed=None
 ):%0A
-
     %22%22%22%0A    Take
@@ -421,32 +421,64 @@
 uTube).%0A    %22%22%22%0A
+    if parsed_feed is None:%0A    
     parsed_feed 
@@ -498,32 +498,32 @@
 parse(feed_url)%0A
-
     for importer
@@ -796,16 +796,34 @@
 feed_url
+, parsed_feed=None
 ):%0A    %22
@@ -926,24 +926,56 @@
 it.%0A    %22%22%22%0A
+    if parsed_feed is None:%0A    
     parsed_f

allow passing in a feedparser instance (to avoid downloading it each time)