'Return Device|Purchased'

def _get_purchased_book_ids(self):

    if ('iPod' in self.sources):
        connected_device = self.sources['iPod']
        if isosx:
            if ('Purchased' in self.iTunes.sources[connected_device].playlists.name()):
                return [pb.database_ID() for pb in self.iTunes.sources[connected_device].playlists['Purchased'].file_tracks()]
            else:
                return []
        elif iswindows:
            dev = self.iTunes.sources.ItemByName(connected_device)
            if (dev.Playlists is not None):
                dev_playlists = [pl.Name for pl in dev.Playlists]
                if ('Purchased' in dev_playlists):
                    return self.iTunes.sources.ItemByName(connected_device).Playlists.ItemByName('Purchased').Tracks
            else:
                return []
