fixed KeyError: 'piece_size' when try to download non-optional file using '|all'

This commit is contained in:
Krzysztof Otręba 2019-08-30 18:59:19 +02:00
parent 912c958ac0
commit baa5df1d01

View file

@ -753,6 +753,11 @@ class SitePlugin(object):
inner_path = inner_path.replace("|all", "")
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"]
piece_size = file_info["piece_size"]