def insert_media_list(self, album, media_list, tags='', user='default',
                          photo_name=None, caption=None):
        """Insert photos or videos into an album.

        Keyword arguments:
          album: The album entry of the album getting the media.
          media_list: A list of paths, each path a picture or video on
                      the local host.
          tags: Text of the tags to be added to each item, e.g. 'Islands, Vacation'
                (Default '').
          caption: Caption/summary to give each item. Default None for no caption.
        """
        album_url = ('/data/feed/api/user/%s/albumid/%s' %
                     (user, album.gphoto_id.text))
        keywords = tags
        if caption is None:
            caption = ''
        failures = []
        for path in media_list:
            LOG.info(safe_encode('Loading file ' + path + ' to album ' +
                                 safe_decode(album.title.text)))

            ext = googlecl.get_extension_from_path(path)
            if not ext:
                LOG.debug('No extension match on path ' + path)
                content_type = 'image/jpeg'
            else:
                ext = ext.lower()
                try:
                    content_type = SUPPORTED_VIDEO_TYPES[ext]
                except __HOLE__:
                    content_type = 'image/' + ext.lower()
            title = photo_name
            if not title:
                title = os.path.split(path)[1]
            try:
                self.InsertPhotoSimple(album_url,
                                       title=title,
                                       summary=caption,
                                       filename_or_handle=path,
                                       keywords=keywords,
                                       content_type=content_type)
            except GooglePhotosException, err:
                LOG.error('Failed to upload %s. (%s: %s)', path,
                          err.args[0],
                          err.args[1])
                failures.append(file)
            except Exception, err:
                # Don't let a stray error wreck an upload of 1000 photos
                LOG.error(safe_encode('Unexpected error -- ' + unicode(err)))
                failures.append(file)
        if failures:
            LOG.info(str(len(failures)) + ' photos failed to upload')
            LOG.debug(safe_encode('Failed files: ' + unicode(failures)))
        return failures
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/picasa/service.py/PhotosServiceCL.insert_media_list