'Assumes pythoncom wrapper for Windows'

def _get_device_books(self):

    if self.verbose:
        logger().info(('\n    %s._get_device_books()' % self.__class__.__name__))
    device_books = []
    if isosx:
        import appscript
        if ('iPod' in self.sources):
            connected_device = self.sources['iPod']
            device = self.iTunes.sources[connected_device]
            if (device.playlists() is not None):
                dev_books = None
                for pl in device.playlists():
                    if (pl.special_kind() == appscript.k.Books):
                        if self.verbose:
                            logger().info(("        Book    playlist:    '%s'" % pl.name()))
                        dev_books = pl.file_tracks()
                        break
                else:
                    logger().error('        book_playlist    not    found')
                for book in dev_books:
                    if (book.kind() in self.Audiobooks):
                        if self.verbose:
                            logger().info(("            ignoring    '%s'    of    type    '%s'" % (book.name(), book.kind())))
                    else:
                        if self.verbose:
                            logger().info(('        %-40.40s    %-30.30s    %-40.40s    [%s]' % (book.name(), book.artist(), book.composer(), book.kind())))
                        device_books.append(book)
                if self.verbose:
                    logger().info()
    elif iswindows:
        import pythoncom
        if ('iPod' in self.sources):
            try:
                pythoncom.CoInitialize()
                connected_device = self.sources['iPod']
                device = self.iTunes.sources.ItemByName(connected_device)
                if (device.Playlists is not None):
                    dev_books = None
                    for pl in device.Playlists:
                        if ((pl.Kind == self.PlaylistKind.index('User')) and (pl.SpecialKind == self.PlaylistSpecialKind.index('Books'))):
                            if self.verbose:
                                logger().info(("        Books    playlist:    '%s'" % pl.Name))
                            dev_books = pl.Tracks
                            break
                    else:
                        if self.verbose:
                            logger().info('        no    Books    playlist    found')
                    for book in dev_books:
                        if (book.KindAsString in self.Audiobooks):
                            if self.verbose:
                                logger().info(("            ignoring    '%s'    of    type    '%s'" % (book.Name, book.KindAsString)))
                        else:
                            if self.verbose:
                                logger().info(('            %-40.40s    %-30.30s    %-40.40s    [%s]' % (book.Name, book.Artist, book.Composer, book.KindAsString)))
                            device_books.append(book)
                    if self.verbose:
                        logger().info()
            finally:
                pythoncom.CoUninitialize()
    return device_books
