> For the complete documentation index, see [llms.txt](https://cloakedkeys.gitbook.io/ofsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloakedkeys.gitbook.io/ofsc/reference-and-help/reference/placeholders.md). Agents can also search and read this documentation through its [MCP server](https://cloakedkeys.gitbook.io/ofsc/~gitbook/mcp).

# Placeholders

These are the names you can use in braces in the `file_options.dir_format`, `file_options.file_format` and `metadata` templates, and in text file names (`ofscraper/classes/placeholder.py`). Each column says which template gets the name.

Templates are filled with Python's `str.format`, so object values allow attribute or key access. Examples are `{modelObj.name}` and `{args.posts}`. Because `config` is a plain dict, `{config[file_options][date]}` also works.

* Profile media (avatar, header) ignore `file_format`. They are saved as `<file_name>.<ext>`.
* When `FILE_COUNT_PLACEHOLDER` is on (the default) and `file_format` uses none of `filename`, `only_file_name`, `original_filename` or `media_id`, `_<count>` is added before the extension. This applies to a post with several media, and to a story or highlight.
* On Fansly, if the `metadata` template uses none of `save_location`, `root`, `site_name` or `model_id` (or their aliases), the site name is added as a subfolder. This keeps Fansly rows out of an OnlyFans `user_data.db`.
* The validators in `ofscraper/prompts/prompt_validators.py` are not called anywhere. They accept only some of these names.

| Placeholder                                                                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{args}`                                                                                    | **Available in:** `dir_format`, `file_format`, `--text`. An object: the parsed command-line arguments (an `AutoDotDict`). Use attribute access, for example `{args.posts}`. A missing name gives `None`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `{config}`                                                                                  | **Available in:** `dir_format`, `file_format`, `--text`. An object: the parsed `config.json` as a dict. Use item syntax, for example `{config[file_options][date]}`. Attribute access does not work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><code>{config\_path}</code><br><em>(also <code>{configpath}</code>)</em></p>             | **Available in:** all. The config home folder, from `common_paths.get_config_home()` (for example `{home_directory}/.config/ofscraper`). It is usually written `{configpath}`, and the default `metadata` path uses it that way.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>{current\_price}</code><br><em>(also <code>{currentprice}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`, `--text`. `Free` if the creator's final current price is 0, else `Paid`. It is `MODEL_PRICE_PLACEHOLDER` (`Unknown_Price` by default) when the model isn't loaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `{date}`                                                                                    | **Available in:** `dir_format`, `file_format`, `--text`. The post's date (`postedAt`, else `createdAt`), formatted with the `file_options.date` config value (arrow tokens, default `MM-DD-YYYY`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><code>{download\_type}</code><br><em>(also <code>{downloadtype}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`. `Protected` for DRM (MPD) media, `Normal` otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `{ext}`                                                                                     | **Available in:** `file_format`, `--text`. The file extension without the dot, for example `mp4` or `jpeg`. It comes from the download's content type: usually its subtype, or the standard extension when the subtype differs (`video/quicktime` gives `mov`, `video/x-matroska` gives `mkv`). A missing or generic type (`application/octet-stream`) gives `mp4` for videos and `jpg` for images. It is `txt` for text files.                                                                                                                                                                                                                                                                                                                            |
| <p><code>{file\_name}</code><br><em>(also <code>{filename}</code>)</em></p>                 | **Available in:** `dir_format`, `file_format`, `--text`. The final media file name without the extension. It is the name from the media URL, or the media id if there is none. Videos get `_<quality>` appended. The name is cleaned and spaces are replaced by `space_replacer`. For text files it is the sanitised, truncated post text. It is usually written `{filename}`, and the default `file_format` is `{filename}.{ext}`.                                                                                                                                                                                                                                                                                                                        |
| <p><code>{first\_letter}</code><br><em>(also <code>{firstletter}</code>)</em></p>           | **Available in:** all. The first letter of the creator's username, upper-cased, for example `A`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `{label}`                                                                                   | **Available in:** `dir_format`, `file_format`, `--text`. The post's label name (on Fansly, the wall name), or the string `None` when it has no label. Only posts found through the Labels area carry one. Files go into a folder per label only when `dir_format` uses `{label}`. With the default `dir_format`, labelled posts are saved with the timeline and labels are recorded only in the `labels` table. A post in both the timeline and a label is downloaded once; with `{label}` in `dir_format`, its folder depends on which area returned it first. A file already downloaded by an earlier run (for example from the timeline) stays where it is and isn't moved or re-downloaded into the label folder unless `--force-all` re-downloads it. |
| <p><code>{media\_id}</code><br><em>(also <code>{mediaid}</code>)</em></p>                   | **Available in:** `dir_format`, `file_format`. The id of the media item. Including it (or a filename field) in `file_format` stops the automatic `_<count>` suffix.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><code>{media\_type}</code><br><em>(also <code>{mediatype}</code>)</em></p>               | **Available in:** `dir_format`, `file_format`, `--text`. The capitalised media kind: `Images`, `Videos` (gifs count as `Videos`), `Audios`, `Forced_skipped`, or `Text` for text files. It is usually written `{mediatype}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `{modelObj}`                                                                                | **Available in:** `dir_format`, `file_format`, `--text`. An object: the creator's model (`ofscraper/classes/of/models.py`) from the model manager. Use attribute access, for example `{modelObj.name}`, `{modelObj.id}` or `{modelObj.final_current_price}`. It is `None` if the creator isn't loaded, so attribute access then fails.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><code>{model\_id}</code><br><em>(also <code>{modelid}</code>)</em></p>                   | **Available in:** all. The creator's numeric account id. OnlyFans ids are short, and Fansly ids are 18-digit snowflakes. The default `metadata` path is `{configpath}/{profile}/.data/{model_id}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><code>{model\_username}</code><br><em>(also <code>{modelusername}</code>)</em></p>       | **Available in:** all. The creator's username. The media and post objects lower-case it for dir and file names.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><code>{my\_id}</code><br><em>(also <code>{myid}</code>)</em></p>                         | **Available in:** all. The numeric id of the logged-in account. It is `anon` in anonymous mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><code>{my\_username}</code><br><em>(also <code>{myusername}</code>)</em></p>             | **Available in:** all. The username of the logged-in account. It is `anon` in anonymous mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <p><code>{only\_file\_name}</code><br><em>(also <code>{onlyfilename}</code>)</em></p>       | **Available in:** `dir_format`, `file_format`, `--text`. Like `{file_name}`, but without the video quality suffix. For text files it is the sanitised post text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>{only\_filename}</code><br><em>(also <code>{onlyfilename}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`, `--text`. The same value as `{only_file_name}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><code>{original\_filename}</code><br><em>(also <code>{originalfilename}</code>)</em></p> | **Available in:** `dir_format`, `file_format`, `--text`. The file name taken from the media URL (the raw media filename, `None` when the media has no URL). For text files it is the sanitised post text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>{post\_id}</code><br><em>(also <code>{postid}</code>)</em></p>                     | **Available in:** `dir_format`, `file_format`, `--text`. The id of the post or message the media belongs to. For text files, it is the post's own id.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `{profile}`                                                                                 | **Available in:** all. The name of the active profile, for example `main_profile`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><code>{promo\_price}</code><br><em>(also <code>{promoprice}</code>)</em></p>             | **Available in:** `dir_format`, `file_format`, `--text`. `Free` or `Paid`, from the creator's final promo price, or `MODEL_PRICE_PLACEHOLDER`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `{quality}`                                                                                 | **Available in:** `dir_format`, `file_format`, `--text`. The selected video quality, such as `1080`, `720`, `240` or `source`. Non-videos and text files are `source` (`QUALITY_UNKNOWN_DEFAULT` when the quality is unknown).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><code>{regular\_price}</code><br><em>(also <code>{regularprice}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`, `--text`. `Free` or `Paid`, from the creator's final regular price, or `MODEL_PRICE_PLACEHOLDER`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>{renewal\_price}</code><br><em>(also <code>{renewalprice}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`, `--text`. `Free` or `Paid`, from the creator's final renewal price, or `MODEL_PRICE_PLACEHOLDER`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>{response\_type}</code><br><em>(also <code>{responsetype}</code>)</em></p>         | **Available in:** `dir_format`, `file_format`, `--text`. The display name of the content area, from the `responsetype` config map. The defaults are Posts, Messages, Archived, Stories, Profile and Streams. Timeline and pinned map to Posts, paid maps to Messages, and highlights map to Stories. Archived posts use the configured Archived name, capitalised like the others, so only its first letter stays uppercase. It is usually written `{responsetype}`.                                                                                                                                                                                                                                                                                       |
| `{root}`                                                                                    | **Available in:** all. A `pathlib.Path` of `{save_location}`: the save location with the Fansly subfolder on Fansly runs. It is the media root unless `dir_format` or `file_format` uses `{site_name}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><code>{save\_location}</code><br><em>(also <code>{savelocation}</code>)</em></p>         | **Available in:** all. The configured save location. On Fansly runs it is `<save location>/Fansly`, even when `{site_name}` in `dir_format` or `file_format` drops that folder from the media path. It has the same value as `{root}`, but as the configured string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><code>{site\_name}</code><br><em>(also <code>{sitename}</code>)</em></p>                 | **Available in:** all. The name of the site being scraped, from `sites.site_name()`. On Fansly runs this is the Fansly name. When `dir_format` or `file_format` uses it, Fansly files get no extra `Fansly` folder (see `file_options.save_location`). It is usually written `{sitename}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `{text}`                                                                                    | **Available in:** `dir_format`, `file_format`, `--text`. For media: the post text, cleaned and truncated to `textlength`. It falls back to the file name, the date, or the media id. For text files: the sanitised, truncated post text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><code>{user\_name}</code><br><em>(also <code>{username}</code>)</em></p>                 | **Available in:** `dir_format`, `file_format`, `--text`. The creator's username, the same as `{model_username}`. Its alias `{username}` also works.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `{username}`                                                                                | **Available in:** `metadata`. The creator's username. In `dir_format`, `file_format` and text files it is also the underscore-free alias of `{user_name}`, with the same value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `{value}`                                                                                   | **Available in:** `dir_format`, `file_format`, `--text`. `Free` or `Paid`, from the post's price. A price of 0 means `Free`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

The underscore-free form is added for every name with an underscore (`add_no_underline`).
