alexpdev / torrentfile

Bittorrent Protocol v1 & v2 metafile creator, checker, editor, builder, reviewer. Assemble .torrent files from the command line.
Apache License 2.0
43 stars 4 forks source link

Add configuration file feature #167

Closed alexpdev closed 1 year ago

alexpdev commented 1 year ago

Suggested enhancement to the CLI.

For example, the command torrentfile create --config /path/to/content would create a new torrentfile from the content using the information listed in a configuration file in the users current working directory called torrentfile.ini.

An example of the ini file:

[config]
announce = http://tracker1.net/21323announce
                    http://tracker2.net/23423announce
                    http://tracker3.org/349089dannounce
private = false
comment = comment to embed in torrent file metadata
source = Tracker3
piece-length = 21
http-seed = https://webpage.com/path/to/content
meta-version = 2
out = /path/to/newly_created.torrent

The cli can then automatically parse the contents of the config file, use preset defaults for any options that are not listed in the config file or on the command line, and consider options specified on the command line to have a higher priority than those indicated in the config file.