forked from sim0n00ps/OF-DL
3.7 KiB
3.7 KiB
AGENTS.md
Purpose
OF DL (OF-DL) is a C# (net10.0) app suite with:
- A modern Avalonia GUI
- A classic CLI
- Shared core services for auth, API calls, downloads, DRM handling, and metadata storage
Architecture at a glance
AuthServiceloadsauth.jsonor runs browser login and saves auth.ApiServicesigns OnlyFans API requests with dynamic rules.DownloadOrchestrationServiceselects creators/lists and coordinates download jobs.DownloadServicedownloads/decrypts media and records metadata viaDBService.
Key directories
OF DL.Cli/: CLI-specific UI/helpersOF DL.Gui/: Avalonia UI, view models, windowsOF DL.Core/Services/: business logic (auth/api/download/config/startup/db/logging)OF DL.Core/Models/: DTOs, entities, config/auth/download/startup models, mappersOF DL.Core/Widevine/: Widevine CDM logicdocs/: MkDocs sourcedocker/: container entrypoint/runtime config
Files and entry points to check first
OF DL.Gui/ViewModels/MainWindowViewModel.csOF DL.Gui/Views/MainWindow.axamlOF DL.Core/Services/ApiService.csOF DL.Core/Services/AuthService.csOF DL.Core/Services/ConfigService.csOF DL.Core/Services/DownloadOrchestrationService.csOF DL.Core/Services/DownloadService.csOF DL.Core/Services/StartupService.csOF DL.Core/Services/DBService.csOF DL.Core/Helpers/EnvironmentHelper.cs
Runtime files (relative to working directory)
config.conf(primary config)auth.json(saved auth)rules.json(dynamic rules fallback)users.db(global user index)chromium-data/(browser profile for auth)cdm/(Widevine device files)
Default download root when DownloadPath is blank:
__user_data__/sites/OnlyFans/{username}
Commands
Build GUI:
dotnet build "OF DL.Gui/OF DL.Gui.csproj"
Build CLI:
dotnet build "OF DL.Cli/OF DL.Cli.csproj"
Tests:
dotnet test "OF DL.Tests/OF DL.Tests.csproj"
Coverage (optional):
dotnet test "OF DL.Tests/OF DL.Tests.csproj" --collect:"XPlat Code Coverage"
High-impact technical details
Dynamic rules and request signing (ApiService.GetDynamicHeaders):
- Remote rules URL:
https://git.ofdl.tools/sim0n00ps/dynamic-rules/raw/branch/main/rules.json - Falls back to local
rules.json - Signed headers include
app-token,sign,time,user-id,user-agent,x-bc,cookie
DRM decryption:
- Preferred: local CDM device files under
cdm/devices/chrome_1610/ - Fallback path exists when CDM files are missing (
ofdl.tools/WV) - Primary flow is in
DownloadService+ DRM helpers inApiService
Documentation update rules
Update docs whenever user-facing behavior changes.
- Config shape/options changed: update
docs/config/configuration.mddocs/config/all-configuration-options.mddocs/config/custom-filename-formats.md(if filename tokens/formats changed)
- Auth/login behavior changed: update
docs/config/auth.md - GUI/CLI workflow changed: update
docs/operation/modern-version.mddocs/operation/classic-version.md(if applicable)
- Docker runtime/paths changed: update
docs/installation/docker.md
Coding style essentials
Follow .editorconfig. Most important rules:
- 4 spaces (2 for XML/YAML/project files), no tabs
- C# braces on new lines
- Prefer predefined types (
int,string) usingdirectives outside namespace,Systemfirst- Private fields
_camelCase; private statics_prefix
Agent guardrails
- Prefer small, targeted changes in the service/viewmodel responsible for the behavior.
- Keep GUI and CLI behavior aligned when changes affect both.
- Do not manually edit generated docs in
site/. - If you add new significant workflow/service structure, update this file.