zeroone2numeral2 / reddit-test

3 stars 1 forks source link

Ability to configure per-subreddit account/client to use #121

Closed RememberTheAir closed 3 years ago

RememberTheAir commented 4 years ago

The config file should be able to contain multiple accounts and clients. One of them should be the default one. Each subreddit can have its own account/client to be used to fetch new submissions

RememberTheAir commented 4 years ago

Example config

[[reddit.accounts]] # needs to be fixed
username = "chemicalpepper"
password = "snQfJt6jnN"

[reddit.clients.reddit-backup]
client_id = "PMf4ZIsiLwDw6A"
client_secret = "dtgCO5vvPLCejvm5WlDU4iK3jTM"
user_agent = "test script by -"

Example json

{
  "reddit": {
    "accounts": [
      {"username": "yyy", "password": "yyy"},
      {"username": "xxx", "password": "xxx"},
    ],
  "clients": {
    "reddit-backup": {
      "client_id": "xxx",
      "client_secret": "xxx",
      "user_agent": "test script by -"
    },
    "test-app": {
      "client_id": "yyy",
      "client_secret": "yyy",
      "user_agent": "test script by -"
    }
  }
}
RememberTheAir commented 3 years ago

New idea:

By default, always enforce the pair client-account

If a client doesn't have an owner, skip to the next least used one

When selecting the least used client, maybe also consider the account usage (balance client-account)