Torrent
SeaDexTorrent
Class to handle torrent files for SeaDex.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
StrPath
|
The path to the torrent file. |
required |
Source code in src/seadex/_torrent.py
sanitize
Sanitizes the torrent file by removing sensitive data and optionally saves it to a new location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
destination
|
StrPath | None
|
The destination path to save the sanitized torrent. If None, the sanitized file is saved in place. |
None
|
overwrite
|
bool
|
If True, overwrites the existing file or destination file if it exists. |
False
|
Returns:
Type | Description |
---|---|
Path
|
The path to the sanitized torrent file. |
Raises:
Type | Description |
---|---|
FileExistsError
|
|
Notes
- If the torrent file is public (i.e., not marked as private), it is returned as is.
- The following fields are removed from the torrent file if it is private:
- Trackers
- Web seeds
- HTTP seeds
- Private flag
- Comment
- Creation date
- Created by field
- Source field
- The torrent's
infohash
is randomized.