Edit
edit
#
Edit torrent module.
Provides a facility by which certain properties of a torrent meta file can be edited by the user. The various command line arguments indicate which fields should be edited, and what the new value should be. Depending on what fields are chosen to edit, this command can trigger a new info hash which means the torrent will no longer be able to participate in the same swarm as the original unedited torrent.
edit_torrent(metafile: str, args: dict) -> dict
#
Edit the properties and values in a torrent meta file.
PARAMETER | DESCRIPTION |
---|---|
metafile |
path to the torrent meta file.
TYPE:
|
args |
key value pairs of the properties to be edited.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
The edited and nested Meta and info dictionaries. |
Source code in torrentfile\edit.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
filter_empty(args: dict, meta: dict, info: dict)
#
Remove the fields that were not used by the original file creator.
PARAMETER | DESCRIPTION |
---|---|
args |
Editable metafile properties from user.
TYPE:
|
meta |
Metafile data dictionary.
TYPE:
|
info |
Metafile info dictionary.
TYPE:
|
Source code in torrentfile\edit.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|