Exemple #1
0
 def get_and_save_cover(self, keyword, destination, filename):
     image_url = self.cover_grabber.grab(keyword)
     if image_url is not None:
         image_downloader = ImageDownloader(destination)
         file_path = image_downloader.download(image_url, filename)
         if file_path is not None:
             return file_path
         else:
             return None
     else:
         return None
Exemple #2
0
    def get_and_save_artist(self, keyword, destination, filename):
        infos = self.artist_infos.get(keyword, None)

        if infos['success']:
            image_downloader = ImageDownloader(destination)
            if infos['infos']['image']:
                file_path = image_downloader.download(infos['infos']['image'],
                                                      filename)
                if file_path:
                    infos['infos']['image'] = file_path
                    return infos
                else:
                    return None
            else:
                return None
Exemple #3
0
 def get_and_save_artist(self, keyword, destination, filename):
     infos = self.artist_infos.get(keyword)
     if infos['success'] is True:
         image_downloader = ImageDownloader(destination)
         if infos['infos']['image'] is not None:
             file_path = image_downloader.download(infos['infos']['image'],
                                                   filename)
             if file_path is not None:
                 infos['infos']['image'] = file_path
                 return infos
             else:
                 return None
         else:
             return None
     else:
         return None