Advanced config options
code-execution
The 'code-execution' feature enables code execution during the generation of metadata, path, file_format, and dir_format.
All available placeholders can be used within these options, and the input for these choices will be transformed into an f-string for processing. As an example
Any Python code that produces a string as its output should work just fine in this context.
custom_values
Before, 'custom' was transformed into a dictionary using Python's built-in JSON library.
While this approach remains an option, OF-Scraper now supports scripting within the 'custom' block, allowing for the inclusion of small scripts directly.
How it works
Each value in dictionary is ran through eval, meaning each value should be a statement that equals some value
You can access the calculated value via
Example
It's crucial to note that when working with strings, the inner quotes hold significance because 'eval' interprets what's inside the quotes as code.
Therefore, maintaining the inner quotes is vital for accurate interpretation by 'eval'.
Changing const
You can change most const values with the custom dict as well
dynamic-mode-default
This is utilized to sign a request, essential for its authorization. Without this, the request would lack proper authorization and fail.
Generally, the options remain mostly identical. However, in rare instances, modifying these options might resolve certain issues with authentication
cache-mode
The script uses DiskCache, which has different options like SQLite and JSON.
For most folks, SQLite works fine, but if you're on a network drive, its performance might not be great. That's when switching to JSON could be a smart move, according to the author
appendlog
If set to False, each run will generate a new log. If set to True, logs will be combined into one file per day.
sanitize_text
If set to true, text content will be sanitized before to database insertion into database
downloadbars
whether to show download progress bars or not
Disabling these can improve performance
temp_dir
This overrides the temporary directory used during download
infinite_loop_action_mode
Sets the script to run in a infinite loop even when --action is used
enable_auto_after
dynamically sets after if enabled
after is set to zero for the first run following that --after was used previously and has been removed in a future run
dynamically sets after based on db status
if disabled after is is set based on --after only
if --after is None, then after will be set as 0
remove_hash_match
If at least two files with identical hashes exist on the system, remove duplicate files identified by those hashes, keeping only one copy on the file system
default_user_list
The default user list used during username scan
default_black_list
The default black list used during username scan
Last updated