diff --git a/steam/client/cdn.py b/steam/client/cdn.py index 661c4b8..d41ca84 100644 --- a/steam/client/cdn.py +++ b/steam/client/cdn.py @@ -413,7 +413,7 @@ class CDNDepotManifest(DepotManifest): if self.name: params = repr(self.name) + ', ' + params - if self.metadata.filenames_encrypted: + if self.filenames_encrypted: params += ', filenames_encrypted=True' return "<%s(%s)>" % ( @@ -658,7 +658,7 @@ class CDNClient(object): self.app_depots[app_id] = self.steam.get_product_info([app_id])['apps'][app_id]['depots'] return self.app_depots[app_id] - def get_manifests(self, app_id, branch='public', password=None, filter_func=None): + def get_manifests(self, app_id, branch='public', password=None, filter_func=None, decrypt=True): """Get a list of CDNDepotManifest for app :param app_id: App ID @@ -694,8 +694,8 @@ class CDNClient(object): if (app_id, branch) not in self.beta_passwords: raise SteamError("Incorrect password for branch %r" % branch) - def async_fetch_manifest(app_id, depot_id, manifest_gid, name): - manifest = self.get_manifest(app_id, depot_id, manifest_gid) + def async_fetch_manifest(app_id, depot_id, manifest_gid, decrypt, name): + manifest = self.get_manifest(app_id, depot_id, manifest_gid, decrypt) manifest.name = name return manifest @@ -743,6 +743,7 @@ class CDNClient(object): app_id, depot_id, manifest_gid, + decrypt, depot_info['name'], )) diff --git a/steam/core/manifest.py b/steam/core/manifest.py index f4f514e..7488d00 100644 --- a/steam/core/manifest.py +++ b/steam/core/manifest.py @@ -159,6 +159,11 @@ class DepotManifest(object): """:type: int""" return self.metadata.cb_disk_compressed + @property + def filenames_encrypted(self): + """:type: bool""" + return self.metadata.filenames_encrypted + def decrypt_filenames(self, depot_key): """Decrypt all filenames in the manifest @@ -256,19 +261,21 @@ class DepotManifest(object): return data.getvalue() def __iter__(self): - for mapping in self.payload.mappings: - yield self.DepotFileClass(self, mapping) + if not self.filenames_encrypted: + for mapping in self.payload.mappings: + yield self.DepotFileClass(self, mapping) def iter_files(self, pattern=None): """ :param pattern: unix shell wildcard pattern, see :func:`.fnmatch` :type pattern: str """ - for mapping in self.payload.mappings: - if (pattern is not None - and not fnmatch(mapping.filename.rstrip('\x00 \n\t'), pattern)): - continue - yield self.DepotFileClass(self, mapping) + if not self.filenames_encrypted: + for mapping in self.payload.mappings: + if (pattern is not None + and not fnmatch(mapping.filename.rstrip('\x00 \n\t'), pattern)): + continue + yield self.DepotFileClass(self, mapping) def __len__(self): return len(self.payload.mappings)