sim0n00ps / OF-DL

C# console app to download all of the media from Onlyfans accounts with DRM video downloading support
569 stars 54 forks source link

Feature Request: Ability to map OF usernames to a new name in config.json #341

Closed melithine closed 1 month ago

melithine commented 2 months ago

This is something that I'd like to actually work on developing, but would likely need a few pointers about how to go about it. But what I'd like to do is define an array of mappings in config.json like:

  "UserNameMappings": {
    "someusername1": "Some Name",
    "someusername1free": "Some Name",
    "someotherusername": "Some Other Name"
  }

On my Plex server, I don't really care what their OF username is, I care about the name of the model instead. Particularly when they're doing industry content as well as indie content, I want them to be in the same Plex collection, which I have based on the filenames. And many models have a free account and a paid account, which serves no useful distinction for me when I'm looking in my Plex libraries.

Then I would change the different filename formats I use to point at a new variable that would render the mapped name instead of the actual OF username, something like this:

  "PaidPostFileNameFormat": "{mappedUsername} - PPV Post - {mediaCreatedAt}_{id}_{mediaid}",
  "PostFileNameFormat": "{mappedUsername} - Post - {mediaCreatedAt}_{id}_{mediaid}",
  "PaidMessageFileNameFormat": "{mappedUsername} - PPV Message - {mediaCreatedAt}_{id}_{mediaid}",
  "MessageFileNameFormat": "{mappedUsername} - Message - {mediaCreatedAt}_{id}_{mediaid}",

If there is no mapping for the username in config.json, then it should just pass up the OF username as it stands.

Doing this, I would be able to just rsync the files over to the correct location on my Plex server. Right now I'm manually renaming the files as I go to upload them, and that's a bit tedious. Like I said, I'd like to actually work on developing this myself, but I'd likely need a few pointers as to how best to go about it.

sim0n00ps commented 2 months ago

You could potentially create a new empty DB file that has a single table in it that has the current username and the username you want it to be. Then when you come to scrape and rename you can check if that username exists in the table and if so then rename it accordingly.

melithine commented 1 month ago

Mooted by the above PR.