Skip to content

allow to disable validation #13

@milahu

Description

@milahu

i want to disable validation like

torrent_models.Torrent.read(some_path, validate=False)

so i can get the v1 and v2 hashes of broken torrent files like

$ python
>>> import torrent_models
>>> torrent_models.Torrent.read("no-piece-layers.torrent")
...
pydantic_core._pydantic_core.ValidationError: 1 validation error for Torrent
  Assertion failed, Hybrid and v2 torrents must have piece layers [type=assertion_error, input_value={'info': {'file tree': {'...2\xa8\xeb\x86:yV\x95G'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/assertion_error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions