Merge pull request #2179 from krzotr/patch-4

KeyError: 'piece_size' in `fileNeed` command in BigfilePlugin when try to download non-optional files with `|all`
This commit is contained in:
ZeroNet 2019-08-30 21:05:46 +02:00 committed by GitHub
commit 879b504b0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -753,6 +753,11 @@ class SitePlugin(object):
inner_path = inner_path.replace("|all", "") inner_path = inner_path.replace("|all", "")
file_info = self.needFileInfo(inner_path) file_info = self.needFileInfo(inner_path)
# Use default function to download non-optional file
if "piece_size" not in file_info:
return super(SitePlugin, self).needFile(inner_path, *args, **kwargs)
file_size = file_info["size"] file_size = file_info["size"]
piece_size = file_info["piece_size"] piece_size = file_info["piece_size"]