fix: support v2 and hybrid qBittorrent identities
This commit is contained in:
@@ -174,7 +174,7 @@ def _v1_files(info: dict[bytes, Any]) -> list[MetaFile]:
|
||||
|
||||
|
||||
def _v2_files(info: dict[bytes, Any]) -> list[MetaFile]:
|
||||
name = _component(info.get(b"name.utf-8", info.get(b"name")))
|
||||
_component(info.get(b"name.utf-8", info.get(b"name")))
|
||||
tree = info.get(b"file tree")
|
||||
if not isinstance(tree, dict):
|
||||
raise BencodeError("v2 metainfo has no file tree")
|
||||
@@ -186,7 +186,7 @@ def _v2_files(info: dict[bytes, Any]) -> list[MetaFile]:
|
||||
if not isinstance(leaf, dict):
|
||||
raise BencodeError("invalid v2 file leaf")
|
||||
result.append(MetaFile(
|
||||
"/".join([name] + components),
|
||||
"/".join(components),
|
||||
_length(leaf.get(b"length")),
|
||||
_padding(leaf),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user