コード例 #1
0
def scrape_file_url(url, shortmem={}):
    try:
        video_enclosure = miroguide_util.get_first_video_enclosure(
            shortmem['feed_item'])
        if video_enclosure is not None:
            return video_enclosure.get('url')
    except KeyError:
        raise errors.FieldNotFound('Could not find the feed_item field')
コード例 #2
0
ファイル: blip.py プロジェクト: crodjer/mirosubs
def scrape_file_url(url, shortmem={}):
    try:
        video_enclosure = miroguide_util.get_first_video_enclosure(
            shortmem['feed_item'])
        if video_enclosure is not None:
            return video_enclosure.get('url')
    except KeyError:
        raise errors.FieldNotFound('Could not find the feed_item field')
コード例 #3
0
ファイル: __init__.py プロジェクト: appsembler/unisubs
def video_count(feed_url, parsed_feed=None):
    """
    Takes a URL for a feed, and returns the number of videos we think we can
    import from it.
    """
    if parsed_feed is None:
        parsed_feed = feedparser.parse(feed_url)
    for importer in IMPORTERS:
        count = importer.video_count(parsed_feed)
        if count is not None:
            return count

    count = 0
    for entry in parsed_feed.entries:
        if miroguide_util.get_first_video_enclosure(entry) is not None:
            count += 1
    return count
コード例 #4
0
ファイル: __init__.py プロジェクト: MechanisM/mirosubs
def video_count(feed_url, parsed_feed=None):
    """
    Takes a URL for a feed, and returns the number of videos we think we can
    import from it.
    """
    if parsed_feed is None:
        parsed_feed = feedparser.parse(feed_url)
    for importer in IMPORTERS:
        count = importer.video_count(parsed_feed)
        if count is not None:
            return count

    count = 0
    for entry in parsed_feed.entries:
        if miroguide_util.get_first_video_enclosure(entry) is not None:
            count += 1
    return count