Пример #1
0
 def get_gog_download_links(self):
     """Return a list of downloadable links for a GOG game"""
     gog_service = GogService()
     if not gog_service.is_available():
         logger.info("You are not connected to GOG")
         connect_gog()
     gog_installers = self.get_gog_installers(gog_service)
     if len(gog_installers) > 1:
         raise ScriptingError("Don't know how to deal with multiple installers yet.")
     try:
         installer = gog_installers[0]
     except IndexError:
         raise UnavailableGame
     download_links = []
     for game_file in installer.get('files', []):
         downlink = game_file.get("downlink")
         if not downlink:
             logger.error("No download information for %s", installer)
             continue
         download_info = gog_service.get_download_info(downlink)
         for field in ('checksum', 'downlink'):
             url = download_info[field]
             logger.info("Adding %s to download links", url)
             download_links.append(download_info[field])
     return download_links
Пример #2
0
 def get_gog_download_links(self):
     """Return a list of downloadable links for a GOG game"""
     gog_service = GogService()
     if not gog_service.is_available():
         logger.info("You are not connected to GOG")
         connect_gog()
     if not gog_service.is_available():
         raise UnavailableGame
     gog_installers = self.get_gog_installers(gog_service)
     if len(gog_installers) > 1:
         raise ScriptingError("Don't know how to deal with multiple installers yet.")
     try:
         installer = gog_installers[0]
     except IndexError:
         raise UnavailableGame
     download_links = []
     for game_file in installer.get('files', []):
         downlink = game_file.get("downlink")
         if not downlink:
             logger.error("No download information for %s", installer)
             continue
         download_info = gog_service.get_download_info(downlink)
         for field in ('checksum', 'downlink'):
             url = download_info[field]
             logger.info("Adding %s to download links", url)
             download_links.append(download_info[field])
     return download_links