File hasing plugin for Flexget
- While it may work on other versions, I only will support Python 3.6+
- I have decided that as the depreciation of Python 2.7 is a little over a year away, I will not be bothering to support it.
- I have plans to add support for asyncio
- HEY, LISTEN: Even though
stop
andtime
are in the schema, they are not implemented yet.
- The default hashing method depends on your python installation:
- If you have Python 3.6+, it will use BLAKE2b
- Otherwise, it will use MD5
- The list of usable methods is determined by
hashlib.algorithms_available
- To use the default hashing method:
file_hash: yes
- To use a custom hashing method (for example sha1):
file_hash: sha1
- You may choose MAX 2 of the following options:
size
,start
,stop
. - Using all three of these together sets up a chance that the difference between
start
andstop
could be either smaller or larger thansize
. - If the
start
position is larger than size of the file, one of two things will happen:
- If the size of the file is smaller than
size
,start
is set to 0, OR - If the size of the file is larger than
size
(but still smaller thanstart
),start
will be set to the size of the file minussize
- To use advanced options, see below
templates:
file_hash_basic:
<<: *any-file-input-plugin
file_hash: yes
file_hash_basic_extended: # These are the settings when you use "file_hash: yes"
<<: *any-file-input-plugin
file_hash:
algorithm: blake2b # Or if your system doesn't have blake2b, this will be md5
size: 25
start: 50
file_hash_algorithm:
<<: *any-file-input-plugin
file_hash: sha1
file_hash_advanced:
<<: *any-file-input-plugin
file_hash:
algorithm: sha256 # Optional, default will be chosen if this is not set
size: 1 # Will hash 1MiB of the given file
start: 25 # Will start at 25MiB into the file, see usage for how this applies to files smaller than this value